pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Kreisler <rod@23net.net>
To: marie.tuite@edisonaffiliates.com
To: Pgsql-Sql@Postgresql. Org <pgsql-sql@postgresql.org>
Subject: Re: sequence question
Date: Mon, 27 Jan 2003 15:17:38 -0500
Message-ID: <JNEGKNDJGBKLBDGPOPFOOEGODHAA.rod@23net.net> (raw)
In-Reply-To: <IGELKLINGDMODABPOOFEGEJHDCAA.marie.tuite@edisonaffiliates.com>

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
>
>




view thread (2+ messages)

Message-ID: <JNEGKNDJGBKLBDGPOPFOOEGODHAA.rod@23net.net>
Permalink:  ../JNEGKNDJGBKLBDGPOPFOOEGODHAA.rod@23net.net/
Also on:    postgresql.org/message-id/JNEGKNDJGBKLBDGPOPFOOEGODHAA.rod@23net.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rod@23net.net, marie.tuite@edisonaffiliates.com
  Subject: Re: sequence question
  In-Reply-To: <JNEGKNDJGBKLBDGPOPFOOEGODHAA.rod@23net.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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