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++)