Where's The Primary Key?
От | Jim Louis |
---|---|
Тема | Where's The Primary Key? |
Дата | |
Msg-id | 000401c3527c$4a94e480$3201a8c0@meadow.prv обсуждение исходный текст |
Ответы |
Re: Where's The Primary Key?
Re: Where's The Primary Key? |
Список | pgsql-novice |
Hi, I'm new to Postgresql and having trouble finding some familiar ground. I'm on Redhat 7.2, and using Postgresql 7.1.3 (I think). Postgresql was installed with the operating system with no "help" on my part. I've created a simple table as shown below and can't find any indication that the primary key was created. I would expect the \d meta-command to show the primary key. (pgaccess also indicates that there is no primary key defined.) I've tried this with a column constraint, a table constraint, with and without the constraint name, and a few other variants. All had the same results. Is the key really there? Shouldn't I see it? Am I doing it wrong or thinking about it wrong? I'd appreciate any help to get me kick-started. db01=> CREATE TABLE junk_t ( db01(> idx int CONSTRAINT junk_idx PRIMARY KEY, db01(> dat int db01(> ); NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'junk_idx' for table 'junk_t' CREATE db01=> \d junk_t Table "junk_t" Attribute | Type | Modifier -----------+---------+---------- idx | integer | not null dat | integer | Index: junk_idx db01=>
В списке pgsql-novice по дате отправления: