Opened 7 years ago

Last modified 2 months ago

#27452 assigned New feature

Add Postgres serial field to contrib.postgres — at Initial Version

Reported by: Johannes Maron Owned by:
Component: contrib.postgres Version: dev
Severity: Normal Keywords:
Cc: info@…, InvalidInterrupt Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Since we have the beautiful contrib.postgres package now, we can add a couple more Postgres specific fields, that are not supported by MySQL but handy to all the Postgres fan boys.

That being said, I guess it's a good idea to start with a serial field. A serial is a 4 byte integer with an implicit sequence. Ergo its and auto increment field for none primary keys! Yeah!

Usecase: You could have a customer number, or invoice number in your code. Usually it is a good idea to not use a natural primary key, therefore reusing the pk as that number could be considered bad. Having a separate field with a separate sequence solves this issue.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top