pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ries van Twisk <ries@jongert.nl>
To: pgsql-sql@postgresql.org
Subject: The need to know if a field is using/connected to a sequence
Date: Thu, 10 Apr 2003 08:36:02 +0200
Message-ID: <002001c2ff2b$757fc6a0$f100000a@IT001> (raw)

I currently use this to get field information of a table:
Now I just want to know (boolean field maby??) if a field is using/connected
to q sequence or not.
Which table should I access to get this information


SELECT
a.attnum,
a.attname AS field,
t.typname AS type,
a.attlen AS length,
a.atttypmod AS lengthvar,
a.attnotnull AS notnull
FROM
pg_class c,
pg_attribute a,
pg_type t
WHERE
c.relname = 'your_table_name'
and a.attnum > 0
and a.attrelid = c.oid
and a.atttypid = t.oid
ORDER BY a.attnum




view thread (3+ messages)  latest in thread

Message-ID: <002001c2ff2b$757fc6a0$f100000a@IT001>
Permalink:  ../002001c2ff2b$757fc6a0$f100000a@IT001/
Also on:    postgresql.org/message-id/002001c2ff2b$757fc6a0$f100000a@IT001

 · 

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: ries@jongert.nl
  Subject: Re: The need to know if a field is using/connected to a sequence
  In-Reply-To: <002001c2ff2b$757fc6a0$f100000a@IT001>

* 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