Thread: [Sqlalchemy-tickets] [sqlalchemy] #2531: PostgreSQL multi-column primary keys reflected in wrong or
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2012-07-10 19:14:42
|
#2531: PostgreSQL multi-column primary keys reflected in wrong order ----------------------+---------------------------------------- Reporter: gthb | Owner: zzzeek Type: defect | Status: new Priority: medium | Milestone: Component: postgres | Severity: trivial - <10 minutes Keywords: | Progress State: awaiting triage ----------------------+---------------------------------------- The reflection query for primary keys on PostgreSQL returns the correct column names, but ordered as they appear in the table, which is not necessarily the way they are ordered in the key. Attaching a patch with a test that exhibits the problem, and a new query that corrects it. The new query also drops the unnecessary join to `pg_class`, but adds a subquery unnesting the key order (I didn't find an obvious way to do this without the subquery). I doubt this is any slower, but I haven't measured. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2531> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |
From: sqlalchemy <mi...@zz...> - 2012-07-10 20:47:53
|
#2531: PostgreSQL multi-column primary keys reflected in wrong order ---------------------------+----------------------------------- Reporter: gthb | Owner: zzzeek Type: defect | Status: new Priority: medium | Milestone: 0.7.9 Component: postgres | Severity: trivial - <10 minutes Resolution: | Keywords: Progress State: in queue | ---------------------------+----------------------------------- Changes (by zzzeek): * status_field: awaiting triage => in queue * milestone: => 0.7.9 -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2531#comment:1> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |
From: sqlalchemy <mi...@zz...> - 2012-08-15 10:17:06
|
#2531: PostgreSQL multi-column primary keys reflected in wrong order ---------------------------+----------------------------------- Reporter: gthb | Owner: zzzeek Type: defect | Status: new Priority: medium | Milestone: 0.7.9 Component: postgres | Severity: trivial - <10 minutes Resolution: | Keywords: Progress State: in queue | ---------------------------+----------------------------------- Comment (by gthb): Updated patches to apply cleanly after recent conflicting whitespace cleanup. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2531#comment:2> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |
From: sqlalchemy <mi...@zz...> - 2012-09-23 17:44:50
|
#2531: PostgreSQL multi-column primary keys reflected in wrong order -----------------------------------+---------------------------------- Reporter: gthb | Owner: zzzeek Type: defect | Status: closed Priority: medium | Milestone: 0.7.9 Component: postgres | Severity: minor - half an hour Resolution: fixed | Keywords: Progress State: completed/closed | -----------------------------------+---------------------------------- Changes (by zzzeek): * status: new => closed * resolution: => fixed * severity: trivial - <10 minutes => minor - half an hour * status_field: in queue => completed/closed Comment: had to put version detection in this with the old query as a fallback, as unnest() and generate_subscripts() are only in PG's docs for version 8.4 and forward. thanks for the patches ! r797ddc37cc7f r2a13915d0ebb -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2531#comment:3> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |
From: sqlalchemy <mi...@zz...> - 2012-09-26 15:47:18
|
#2531: PostgreSQL multi-column primary keys reflected in wrong order -----------------------------------+---------------------------------- Reporter: gthb | Owner: zzzeek Type: defect | Status: closed Priority: medium | Milestone: 0.7.9 Component: postgres | Severity: minor - half an hour Resolution: fixed | Keywords: Progress State: completed/closed | -----------------------------------+---------------------------------- Comment (by gthb): Sure. You didn't include the test though ... was that deliberate? Reattaching as a separate patch if you want it, with `@testing.fails_if(('postgresql', '<', (8, 4)))` added. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2531#comment:4> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |
From: sqlalchemy <mi...@zz...> - 2012-09-26 15:50:23
|
#2531: PostgreSQL multi-column primary keys reflected in wrong order -----------------------------------+---------------------------------- Reporter: gthb | Owner: zzzeek Type: defect | Status: closed Priority: medium | Milestone: 0.7.9 Component: postgres | Severity: minor - half an hour Resolution: fixed | Keywords: Progress State: completed/closed | -----------------------------------+---------------------------------- Comment (by gthb): Well that was a nice bout of brain flatulence I just had. You did include the test. Please disregard. :) -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2531#comment:5> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |