#34255: Annotation/group by with an expression on psycopg3
-------------------------------------+-------------------------------------
     Reporter:  Guillaume Andreu     |                    Owner:  nobody
  Sabater                            |
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:  orm postgres         |             Triage Stage:  Accepted
  psycopg3 annotation groupby        |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

 > Edit, another solution could be to have the psycopg3 query %s -> $n
 logic de-duplicate equal values and avoid using multiple placeholders for
 them. That would result in the query being written as the user reported
 here at the expense of equality checks (or possibly identity/hash checks
 which are cheaper) on each query creation which I believe would require
 adjustments to the current caching strategy.

 Yeah, the same as
 
[https://github.com/django/django/blob/648005dee62481acc1784e5c9625e90f0fd6aab4/django/db/backends/oracle/base.py#L533-L546
 we do on Oracle]. Unfortunately, it has [https://groups.google.com/g
 /django-developers/c/1hqw_HTpn_8/m/JzA_ma2pAQAJ side-effects] :|

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34255#comment:7>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070185a9f4f49b-3789bdb3-5e86-4a27-8802-38d056fee088-000000%40eu-central-1.amazonses.com.

Reply via email to