Index: pg.py
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/interfaces/python/pg.py,v
retrieving revision 1.9
diff -u -r1.9 pg.py
--- pg.py	2002/03/19 13:20:52	1.9
+++ pg.py	2002/08/08 03:29:48
@@ -69,7 +69,8 @@
 						WHERE pg_class.oid = pg_attribute.attrelid AND
 							pg_class.oid = pg_index.indrelid AND
 							pg_index.indkey[0] = pg_attribute.attnum AND 
-							pg_index.indisprimary = 't'""").getresult():
+							pg_index.indisprimary = 't' AND
+							pg_attribute.attisdropped = 'f'""").getresult():
 			self.__pkeys__[rel] = att
 
 	# wrap query for debugging
@@ -111,7 +112,8 @@
 					WHERE pg_class.relname = '%s' AND
 						pg_attribute.attnum > 0 AND
 						pg_attribute.attrelid = pg_class.oid AND
-						pg_attribute.atttypid = pg_type.oid"""
+						pg_attribute.atttypid = pg_type.oid AND
+						pg_attribute.attisdropped = 'f'"""
 
 		l = {}
 		for attname, typname in self.db.query(query % cl).getresult():
Index: tutorial/syscat.py
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/interfaces/python/tutorial/syscat.py,v
retrieving revision 1.7
diff -u -r1.7 syscat.py
--- tutorial/syscat.py	2002/05/03 14:21:38	1.7
+++ tutorial/syscat.py	2002/08/08 03:29:48
@@ -37,7 +37,7 @@
 		FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a
 		WHERE i.indrelid = bc.oid AND i.indexrelid = bc.oid
 				AND i.indkey[0] = a.attnum AND a.attrelid = bc.oid
-				AND i.indproc = '0'::oid
+				AND i.indproc = '0'::oid AND a.attisdropped = 'f'
 		ORDER BY class_name, index_name, attname""")
 	return result
 
@@ -48,6 +48,7 @@
 		WHERE c.relkind = 'r' and c.relname !~ '^pg_'
 			AND c.relname !~ '^Inv' and a.attnum > 0
 			AND a.attrelid = c.oid and a.atttypid = t.oid
+                        AND a.attisdropped = 'f'
 			ORDER BY relname, attname""")
 	return result
 
