Changeset 386 for trunk/module/pg.py


Ignore:
Timestamp:
Dec 4, 2008, 3:28:06 PM (11 years ago)
Author:
cito
Message:

Added note about composite primary keys.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/pg.py

    r385 r386  
    66# Improved by Christoph Zwerschke
    77#
    8 # $Id: pg.py,v 1.71 2008-12-04 20:12:52 cito Exp $
     8# $Id: pg.py,v 1.72 2008-12-04 20:28:06 cito Exp $
    99#
    1010
     
    329329                (_join_parts(r[:2]), r[2]) for r in self.db.query(
    330330                "SELECT pg_namespace.nspname, pg_class.relname"
    331                     ",pg_attribute.attname FROM pg_class"
     331                    ", pg_attribute.attname FROM pg_class"
    332332                " JOIN pg_namespace ON pg_namespace.oid=pg_class.relnamespace"
    333333                    " AND pg_namespace.nspname NOT LIKE 'pg_%'"
     
    336336                " JOIN pg_index ON pg_index.indrelid=pg_class.oid"
    337337                    " AND pg_index.indisprimary='t'"
     338                    # note that this gets only the first attribute
     339                    # of composite primary keys
    338340                    " AND pg_index.indkey[0]=pg_attribute.attnum"
    339341                ).getresult()])
Note: See TracChangeset for help on using the changeset viewer.