Opened 7 years ago

Last modified 2 months ago

#27452 assigned New feature

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

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 (last modified by Burhan Khalid)

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 Serial.

The PostgreSQL documentation: https://www.postgresql.org/docs/9.1/static/datatype-numeric.html describes the field as follows:

The data types serial and bigserial are not true types, but merely a notational convenience for creating unique identifier columns (similar to the AUTO_INCREMENT property supported by some other databases).

Use Cases:

  1. Anywhere an automatic incrementing value is required, but a primary key is often (mis)used.
  2. Providing additional (user controlled) auto-incrementing values.

The primary benefit is that is isolates the primary key for the sole use of maintaining referential integrity.

Change History (1)

comment:1 by Burhan Khalid, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top