#30511: Support Identity columns on PostgreSQL.
-------------------------------------+-------------------------------------
     Reporter:  Michael Kany         |                    Owner:  Michael
                                     |  Kany
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  postgres generated   |             Triage Stage:  Accepted
  identity                           |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

 FWIW I think that we shouldn't be introducing a new field for this but
 instead swap `AutoField` to use `int GENERATED BY DEFAULT AS IDENTITY`
 instead of `serial` on PostgreSQL 10+.

 From Django's perspective both behave the same anyway and I think the
 cases where other `IDENTITY` options make sense are very limited or cause
 conflicts with the way the ORM works which makes me believe we shouldn't
 support them even in `contrib.postgres`. For example, `GENERATED ALWAYS AS
 IDENTITY` would completely ignore any value provided for the field which
 differs from all the other fields behavior.

 I guess we could also include
 [https://www.2ndquadrant.com/en/blog/postgresql-10-identity-columns/ an
 update script] in the release notes for users that want to avoid having a
 mix of `serial` and `IDENTITY` primary keys.

 Just my 2 cents.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30511#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.a67fc30d12d1c8090f85624bf34bbbfd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to