From: | "Rod Kreisler" <rod(at)23net(dot)net> |
---|---|
To: | <marie(dot)tuite(at)edisonaffiliates(dot)com>, "Pgsql-Sql(at)Postgresql(dot) Org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: sequence question |
Date: | 2003-01-27 20:17:38 |
Message-ID: | JNEGKNDJGBKLBDGPOPFOOEGODHAA.rod@23net.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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: pgsql-sql-owner(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Marie G. Tuite
> Sent: Monday, January 27, 2003 3:06 PM
> To: Pgsql-Sql(at)Postgresql(dot) 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 majordomo(at)postgresql(dot)org
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Rodger Donaldson | 2003-01-28 07:05:15 | Cross-table constraints |
Previous Message | Bruce Momjian | 2003-01-27 20:14:57 | Re: [SQL] Function for adding Money type |