Re: The need to know if a field is using/connected to a sequence
От | A.Bhuvaneswaran |
---|---|
Тема | Re: The need to know if a field is using/connected to a sequence |
Дата | |
Msg-id | Pine.LNX.4.44.0304101341560.1046-100000@Bhuvan.bksys.co.in обсуждение исходный текст |
Ответ на | The need to know if a field is using/connected to a sequence ("Ries van Twisk" <ries@jongert.nl>) |
Ответы |
Re: The need to know if a field is using/connected to a sequence
|
Список | 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 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
В списке pgsql-sql по дате отправления: