Michelle Konzack wrote:
> > I think you want a sequence. Give the serial number the type
bigserial or
> > serial.  See
> >
http://www.postgresql.org/docs/current/static/functions-sequence.html
for
> > more.
> 
> OK, thats cool...  I have found an example in
"sql-createsequence.html"
> 
> CREATE SEQUENCE serial START 1;
> 
> INSERT INTO distributors VALUES (nextval('serial'), 'nothing');
> 
> But there is one thing not clear:
> 
> Du I need to create a SEQUENCE for each table or do I need only  ONE
of
> if and can use it independant on differnt tables?

You can use one sequence for many tables.

If you follow the advice by Nikolas Everett and use a "serial" column,
that would create one dedicated sequence per serial column.

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to