PostgreSQL: serial vs integer sequences?
Jim Pistrang
jim at jpcr.com
Mon Mar 6 06:16:05 EST 2017
Hi Nick,
My understanding (and I'm something of a Postgres newbie) is that when you create a table with a column of type serial it automatically generates a sequence object linked to the column and then creates the column as integer. Lots of info online if you google 'postgres serial'
Jim
>Hi Everybody,
>
>We recently upgraded our Postgres server from v9.4 to v9.6 and
>exported/imported
>all our data in doing so. I noticed that all the columns of type serial
>have been
>converted to integer. The sequences are still in place, so I didn't
>think too much
>of it, but now that I need to create some new tables, I am wondering:
>
>Is there any reason NOT to use the serial type for sequence fields?
>
>Using integer fields for sequences seems so much clunkier.
>
>Cheers,
>
>Nick Renders
>
>_____________________________________________________________
>Manage your list subscriptions at http://lists.omnis-dev.com
>
--
Jim Pistrang
JP Computer Resources
413-256-4569
<http://www.jpcr.com>
More information about the omnisdev-en
mailing list