- Timestamp:
- 08/01/07 12:51:59 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/schema-evolution/django/db/backends/postgresql/introspection.py
r5735 r5784 98 98 unique_conname = None 99 99 shared_unique_connames = set() 100 cursor.execute("select pg_constraint.conname, pg_constraint.contype, pg_attribute.attname from pg_constraint, pg_attribute where pg_constraint.conrelid=pg_attribute.attrelid and pg_attribute.attnum=any(pg_constraint.conkey) and pg_constraint.conname~'^%s'" % table_name )100 cursor.execute("select pg_constraint.conname, pg_constraint.contype, pg_attribute.attname from pg_constraint, pg_attribute, pg_class where pg_constraint.conrelid=pg_class.oid and pg_constraint.conrelid=pg_attribute.attrelid and pg_attribute.attnum=any(pg_constraint.conkey) and pg_class.relname='%s'" % table_name ) 101 101 for row in cursor.fetchall(): 102 # print row 102 103 if row[2] == column_name: 103 104 if row[1]=='p': dict['primary_key'] = True
