#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 Michael Kany):

 sorry,
 I've seen that instead of the proposed two new Field classes
 ('IdentityAutoField': 'integer', 'IdentityBigAutoField': 'bigint',)
 Is it possible to extend the AutoField class like this?
 For example with:

 class AutoField (Field):
 ...
 generated_identity = False # for the serial or generated distinction
 generated_by_default = false # for GENERATED ALWAYS if false / GENERATED
 BY DEFAULT if true
 seq_opt_start_with = 1
 seq_opt_increment_by = 1

 def __init __ (self, generated_identity = false, generated_by_default =
 false, seq_opt_start_with = 1, seq_opt_increment_by = 1, ** kwargs):
 ...

 There is another ticket
 # 56 Primary key columns should be UNSIGNED
 that with the parameters
 seq_opt_start_with = 1
 seq_opt_increment_by = 1
 would fit if necessary. Test if seq_opt_start_with> = 0

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30511#comment:9>
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.281678674bb7c9d34f1d9d67f18a1712%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to