diff's between creations of tables

From: "G(dot)L(dot) Grobe" <gary(at)grobe(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: diff's between creations of tables
Date: 2001-07-26 05:40:12
Message-ID: 000b01c11595$70c05d90$0200a8c0@trinity
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

When creating an incremental and unique id, what are the benefits of using:

CREATE TABLE tablename (colname SERIAL);

instead of :

CREATE SEQUENCE tablename_colname_seq;
CREATE TABLE tablename
(colname integer DEFAULT nextval('tablename_colname_seq');
CREATE UNIQUE INDEX tablename_colname_key on tablename (colname);

One is easier do delete as a dropdb dbname would do it, but anything else I
should know. Or which one is the general practice, any rules of thumb to
use, etc...

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2001-07-26 06:01:30 Re: Good random numbers in PG? And crypto-wishlist
Previous Message Dr. Evil 2001-07-26 05:36:47 Re: diff's between creations of tables

Browse pgsql-novice by date

  From Date Subject
Next Message Joel Burton 2001-07-26 09:29:17 Re: diff's between creations of tables
Previous Message Dr. Evil 2001-07-26 05:36:47 Re: diff's between creations of tables