Where's The Primary Key? - Mailing list pgsql-novice

From Jim Louis
Subject Where's The Primary Key?
Date
Msg-id 000401c3527c$4a94e480$3201a8c0@meadow.prv
Whole thread Raw
Responses Re: Where's The Primary Key?  (Nabil Sayegh <postgresql@e-trolley.de>)
Re: Where's The Primary Key?  ("A.Bhuvaneswaran" <bhuvan@symonds.net>)
List 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 by date:

Previous
From: Jay R
Date:
Subject: ...
Next
From: Nabil Sayegh
Date:
Subject: Re: Where's The Primary Key?