Re: sequence question - Mailing list pgsql-sql

From Rod Kreisler
Subject Re: sequence question
Date
Msg-id JNEGKNDJGBKLBDGPOPFOOEGODHAA.rod@23net.net
Whole thread Raw
In response to sequence question  ("Marie G. Tuite" <marie.tuite@edisonaffiliates.com>)
List 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@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]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 majordomo@postgresql.org
>
>



pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Function for adding Money type
Next
From: "william windels"
Date:
Subject: converting microsoft sql server 2000 sql-code for postgresql 7.2.1