Re: pg_dump and search_path
От | Alvaro Herrera |
---|---|
Тема | Re: pg_dump and search_path |
Дата | |
Msg-id | 20150811173120.GB3040@postgresql.org обсуждение исходный текст |
Ответ на | pg_dump and search_path ("Steve Thames" <sthames42@gmail.com>) |
Ответы |
Re: pg_dump and search_path
|
Список | pgsql-hackers |
Steve Thames wrote: > SELECT a.attnum, n.nspname, c.relname, d.adsrc AS default_value > FROM pg_attribute AS a > JOIN pg_class AS c ON a.attrelid = c.oid > JOIN pg_namespace AS n ON c.relnamespace = n.oid > LEFT JOIN pg_attrdef AS d ON d.adrelid = c.oid AND d.adnum = a.attnum > WHERE a.attnum > 0 > AND n.nspname = 'testschema' > AND c.relname = 'testtable'; Don't ever rely on adsrc. It's useless. Use pg_get_expr(adbin) instead. That's safe, for instance, if the sequence gets renamed. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: