> 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
How can a boolean field use/connect q sequence? I got that you want to
know the fields which use sequence for their default value. If i am right,
here is the solution. The default value details are in pg_attrdef table.
SELECT
a.attnum,
c.relname,
a.attname,
d.adsrc as default
from
pg_attribute a,
pg_class c,
pg_attrdef d
where
a.attrelid = c.oid
and a.attnum = d.adnum
and d.adrelid = c.oid
and a.attnum > 0
and c.relname = 'your_table_name'
and d.adsrc ~* 'your_sequence_name'
order by a.attnum;
Hope it helps.
regards,
bhuvaneswaran