Re: [HACKERS] alter table crashes back end - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] alter table crashes back end
Date
Msg-id 11253.944793750@sss.pgh.pa.us
Whole thread Raw
In response to alter table crashes back end  (Don Baccus <dhogaza@pacifier.com>)
List pgsql-hackers
Don Baccus <dhogaza@pacifier.com> writes:
> alter table foo add();
> crashes the backend.

> I'd say it's really low priority, but should be fixed.

A crash is never a good thing.  If you feel like patching your
copy, the problem is in backend/parser/gram.y:

***************
*** 759,769 ****                 }             | ADD '(' OptTableElementList ')'                 {
-                     Node *lp = lfirst($3);
-                      if (length($3) != 1)                         elog(ERROR,"ALTER TABLE/ADD() allows one column
only");
!                     $$ = lp;                 }             | DROP opt_column ColId                 {
elog(ERROR,"ALTERTABLE/DROP COLUMN not yet implemented"); }
 
--- 759,767 ----                 }             | ADD '(' OptTableElementList ')'                 {
if(length($3) != 1)                         elog(ERROR,"ALTER TABLE/ADD() allows one column only");
 
!                     $$ = (Node *) lfirst($3);                 }             | DROP opt_column ColId                 {
  elog(ERROR,"ALTER TABLE/DROP COLUMN not yet implemented"); }
 
***************

Line numbers certainly not right for 6.5 ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce)
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce)