Serial Data type

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: uysimty(at)gmail(dot)com
Subject: Serial Data type
Date: 2019-03-12 03:53:10
Message-ID: 155236279038.30378.14142920824129653613@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/datatype-numeric.html
Description:

I read the doc at
https://www.postgresql.org/docs/11/datatype-numeric.html#DATATYPE-SERIAL. I
want to clarify how psql generate the sequence to existing data. Example if
I alter a table to add serial column so I will generate sequence value base
on integer to the existing data. So how did psql order in that case to
generate 1, 2, 3. Does it order by the created timestamp of the record or
the primary key of the table? is there a way to set the order when we alter
table?

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2019-03-14 12:40:38 Re: First SVG graphic
Previous Message Jürgen Purtz 2019-03-12 03:14:39 Re: First SVG graphic