The need to know if a field is using/connected to a sequence

From: "Ries van Twisk" <ries(at)jongert(dot)nl>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: The need to know if a field is using/connected to a sequence
Date: 2003-04-10 06:36:02
Message-ID: 002001c2ff2b$757fc6a0$f100000a@IT001
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A.Bhuvaneswaran 2003-04-10 08:25:37 Re: The need to know if a field is using/connected to a sequence
Previous Message Rajesh Kumar Mallah 2003-04-10 04:41:19 Re: question about visibilty while updating multiple rows .