I tested the latest and greatest version of the sequence query:

SELECT substring((SELECT substring(pg_get_expr(d.adbin, d.adrelid)
for 128) FROM pg_attrdef d
 WHERE d.adrelid = a.attrelid
 AND d.adnum = a.attnum
 AND a.atthasdef
 ) FROM 'nextval[^'']*''([^'']*)')
 FROM pg_attribute a
 LEFT JOIN pg_class c ON c.oid = a.attrelid
 LEFT JOIN pg_attrdef d ON d.adrelid = a.attrelid AND d.adnum =
 a.attnum AND a.atthasdef
 LEFT JOIN pg_namespace n ON c.relnamespace = n.oid
 WHERE (c.relname = 'mytest') AND a.attname = 'pkid'
 and n.nspname='public'
 AND NOT a.attisdropped
 AND a.attnum > 0
 AND pg_get_expr(d.adbin, d.adrelid) LIKE 'nextval%'

It works on 7.4.19, 8.0.14, 8.2.3 and 8.3beta3. 
--
Adrian Klaver
[EMAIL PROTECTED]


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to