Thread: serial field starting at specific value

serial field starting at specific value

From
Robert Mosher
Date:
Is there a way I can specify which value a serial field starts at? I
would like to have it start at some arbitrary value, say 10, or 100, so
that no element in a table has a key lower than that.

Thanks,
Rob Mosher

Re: serial field starting at specific value

From
Tom Lane
Date:
Robert Mosher <mosher@andrews.edu> writes:
> Is there a way I can specify which value a serial field starts at?

Use setval() on the sequence created for the serial column.

            regards, tom lane