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

From Nabil Sayegh
Subject Re: Where's The Primary Key?
Date
Msg-id 1059360137.2148.36.camel@billy
Whole thread Raw
In response to Where's The Primary Key?  ("Jim Louis" <jim.louis@worldnet.att.net>)
List pgsql-novice
Am Fre, 2003-07-25 um 09.13 schrieb Jim Louis:
>          Table "junk_t"
>  Attribute |  Type   | Modifier
> -----------+---------+----------
>  idx       | integer | not null
>  dat       | integer |
> Index: junk_idx

\d junk_idx

apart from that, it's much easier just to do:

...
idx int PRIMARY KEY,
...

Just leave the naming of the index to postgresql.

FYI:
You may also want to use SERIAL instead of INT.
It creates INT but with (auto-filled) serial numbers (auto increment).

hth
--
 e-Trolley Sayegh & John, Nabil Sayegh
 Tel.: 0700 etrolley /// 0700 38765539
 Fax.: +49 69 8299381-8
 PGP : http://www.e-trolley.de


pgsql-novice by date:

Previous
From: "Jim Louis"
Date:
Subject: Where's The Primary Key?
Next
From: "A.Bhuvaneswaran"
Date:
Subject: Re: Accessing Postgres db from apache using PHP