Re: Bug #951: Creating table fails if inherited table has no columns.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug #951: Creating table fails if inherited table has no columns.
Дата
Msg-id 29600.1050938650@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug #951: Creating table fails if inherited table has no columns.  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
pgsql-bugs@postgresql.org writes:
> Creating table fails if inherited table has no columns.

Good catch.  Here's the patch if you need it right away.

            regards, tom lane

*** src/backend/commands/tablecmds.c~    Mon Dec 16 13:39:56 2002
--- src/backend/commands/tablecmds.c    Mon Apr 21 11:20:02 2003
***************
*** 576,584 ****
           * newattno[] will contain the child-table attribute numbers for
           * the attributes of this parent table.  (They are not the same
           * for parents after the first one, nor if we have dropped
!          * columns.)
           */
!         newattno = (AttrNumber *) palloc(tupleDesc->natts * sizeof(AttrNumber));

          for (parent_attno = 1; parent_attno <= tupleDesc->natts;
               parent_attno++)
--- 576,585 ----
           * newattno[] will contain the child-table attribute numbers for
           * the attributes of this parent table.  (They are not the same
           * for parents after the first one, nor if we have dropped
!          * columns.)  +1 is to prevent error if parent has zero columns.
           */
!         newattno = (AttrNumber *)
!             palloc((tupleDesc->natts + 1) * sizeof(AttrNumber));

          for (parent_attno = 1; parent_attno <= tupleDesc->natts;
               parent_attno++)

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

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #951: Creating table fails if inherited table has no columns.
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #952: real type in WHERE