Re: BUG #5856: pg_attribute.attinhcount is not correct.
От | Robert Haas |
---|---|
Тема | Re: BUG #5856: pg_attribute.attinhcount is not correct. |
Дата | |
Msg-id | AANLkTik6ArKPwnvA8_9XHo9j9+w4A2UEnsheX-mwR=Aj@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #5856: pg_attribute.attinhcount is not correct. ("Naoya Anzai" <anzai-naoya@mxu.nes.nec.co.jp>) |
Список | pgsql-bugs |
On Mon, Jan 31, 2011 at 6:42 AM, Naoya Anzai <anzai-naoya@mxu.nes.nec.co.jp> wrote: > In PostgreSQL8.4.5, I found that the catalog pg_attribute.attinhcount is = not > correct. > > I executed the following queries. > > -------------------------------------------------------------------------- > create table "3_grandchild"(); > create table "2_child"(); > create table "1_parent"(); > > alter table "3_grandchild" inherit "2_child"; > alter table "2_child" inherit "1_parent"; > > alter table "3_grandchild" add column c1 text; > alter table "2_child" add column c1 text; > alter table "1_parent" add column c1 text; > > select c.relname,a.attname,a.attinhcount from pg_attribute a,pg_class c > where a.attrelid=3Dc.oid > and relname in ('1_parent','2_child','3_grandchild') > and attname not in('xmax','xmin','cmin','cmax','tableoid','ctid') > order by relname; > > =A0 =A0relname =A0 =A0| attname | attinhcount > =A0--------------+---------+------------- > =A01_parent =A0 =A0 | c1 =A0 =A0 =A0| =A0 =A0 =A0 =A0 =A0 0 > =A02_child =A0 =A0 =A0| c1 =A0 =A0 =A0| =A0 =A0 =A0 =A0 =A0 1 > =A03_grandchild | c1 =A0 =A0 =A0| =A0 =A0 =A0 =A0 =A0 2 > =A0(3 rows) > -------------------------------------------------------------------------- > > "3_grandchild"'s attinhcount should be 1. I think this is a manifestation the same problem mentioned here: http://git.postgresql.org/gitweb?p=3Dpostgresql.git;a=3Dcommit;h=3D31b6fc06= d83c6de3644c8f2921eb7de0eb92fac3 I believe this requires some refactoring to fix. It would be good to do th= at. --=20 Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-bugs по дате отправления: