Primary key data type: integer vs identity

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Primary key data type: integer vs identity
Date: 2019-04-19 17:55:29
Message-ID: alpine.LNX.2.20.1904191050120.24219@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When I created the database I set primary key data types as integer; for
example:

Column | Type | Collation | Nullable | Default
--------------+-----------------------+-----------+----------+-------------
org_id | integer | | not null |
nextval('organizations_org_id_seq'::regclass)

I probably should have used the serial type, but didn't.

If it would be advisable for me to convert from integer to identity please
point me to the appropriate work flow.

Reading the CREATE TABLE pages in the manual did not give me sufficient
insights to appreciate the differences or indicate how to change the
column's data type.

Regards,

Rich

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-04-19 18:05:09 Re: Primary key data type: integer vs identity
Previous Message Peter J. Holzer 2019-04-19 08:45:27 Re: PostgreSQL ping/pong to client