Given this UI in pgAdmin4, what's the difference between these two options:
Identity
Generated
I'm from a SQL Server background, so I'm used to setting the IDENTITY
of an INT
, for those MSSql tables to auto-generate that column value.
How is this different/similar in Postgres?
What is interesting is when I check out the GENERATED
option, I get this menu, now?
While the IDENTITY
option looks like I need to specify everything. So is the difference that IDENTITY
is very hard-coded specific, while the GENERATED
is 'let me auto set everything up, except for some expression thingy?'
NOTE: Using the latest Docker image of Postgres, so let's assume v10+ (with regards to serial
now being off the table in this discussion).
Similar questions: