select relname as table, attname as column from pg_class c join pg_attribute a on c.oid=a.attrelid join pg_attrdef d on a.attnum=d.adnum where adsrc='nextval(\'"SEQUENCE_NAME_SEQ"\'::text)'\ AND d.adrelid=c.oid;
There may be a more efficient query, but I wasn't too worried about figuring it out... HTH Rod > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Marie G. Tuite > Sent: Monday, January 27, 2003 3:06 PM > To: Pgsql-Sql@Postgresql. Org > Subject: [SQL] sequence question > > > Hey there, > > Does anybody have a nice way to identify what table.column is using a > particular sequence on a database-wide basis? > > --Thanks. > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] > > ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])