Search Postgresql Archives

Re: Equivalent for AUTOINCREMENT?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





# create table foo( a SERIAL );
NOTICE: CREATE TABLE will create implicit sequence "foo_a_seq" for serial column "foo.a"
CREATE TABLE

# \d+ foo
  Table "public.foo"
 Column | Type | Modifiers | Description
--------+---------+-------------------------------------------------+-------------
 a | integer | not null default nextval('foo_a_seq'::regclass) |
Has OIDs: no

AUTOINCREMENT has so many problems, that soon you'll start to love sequences so much, you'll start to hate mysql's childlish approach to problem solving :)
Also make sure you read carefuly: http://www.postgresql.org/docs/8.3/static/sql-createsequence.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux