Re: BUG #13034: Inconsistent attrelid field in pg_attribute table after adding columns to table.

Поиск
Список
Период
Сортировка
От Alejandro Sánchez Medina
Тема Re: BUG #13034: Inconsistent attrelid field in pg_attribute table after adding columns to table.
Дата
Msg-id CANNENjwquvdQKs7STLuks1PGvJ9Xp2OYqm5U19QfTp6FB3k+bg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #13034: Inconsistent attrelid field in pg_attribute table after adding columns to table.  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
Thank you very much for the quick reply.

It indeed worked and I apologise for filling the issue as a bug.

Best regards,
Alejandro

2015-04-13 14:25 GMT+01:00 Alvaro Herrera <alvherre@2ndquadrant.com>:
alemagox@gmail.com wrote:

> SELECT format_type(a.atttypid, a.atttypmod)
>     FROM pg_attribute a
>         JOIN pg_class b ON (a.attrelid = b.relfilenode)
>         JOIN pg_namespace c ON (c.oid = b.relnamespace)
>     WHERE b.relname = 'test' AND c.nspname = 'ab' AND a.attname = 'id';

pg_attribute.attrelid must be joined to pg_class.oid, not relfilenode.
The relfilenode changes when the table is rewritten, which happens
during some forms of ALTER TABLE and others.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

В списке pgsql-bugs по дате отправления:

Предыдущее
От: cestel@covermymeds.com
Дата:
Сообщение: BUG #13042: pg_upgrade --check succeeded but run failed due to missing thesaurus file
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)