pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
sequence question
2+ messages / 2 participants
[nested] [flat]

* sequence question
@ 2003-01-27 20:06 Marie G. Tuite <marie.tuite@edisonaffiliates.com>
  2003-01-27 20:17 ` Re: sequence question Rod Kreisler <rod@23net.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Marie G. Tuite @ 2003-01-27 20:06 UTC (permalink / raw)
  To: pgsql-sql

Hey there,

Does anybody have a nice way to identify what table.column is using a
particular sequence on a database-wide basis?

--Thanks.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: sequence question
  2003-01-27 20:06 sequence question Marie G. Tuite <marie.tuite@edisonaffiliates.com>
@ 2003-01-27 20:17 ` Rod Kreisler <rod@23net.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Rod Kreisler @ 2003-01-27 20:17 UTC (permalink / raw)
  To: marie.tuite@edisonaffiliates.com; 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
>
>




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-01-27 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-27 20:06 sequence question Marie G. Tuite <marie.tuite@edisonaffiliates.com>
2003-01-27 20:17 ` Rod Kreisler <rod@23net.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox