Re: alter table add x wrong error position - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: alter table add x wrong error position
Date
Msg-id CAKFQuwbs_1ask7XCFFzBu_bKodU=rRy9v5Nn_NBH73zcRNBFcQ@mail.gmail.com
Whole thread Raw
In response to alter table add x wrong error position  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On Sunday, January 7, 2024, jian he <jian.universality@gmail.com> wrote:
hi.
Maybe this is a small printout err_position bug.

create table atacc2 ( test int, a int, b int) ;
success tests:
alter table atacc2 add CONSTRAINT x PRIMARY KEY (id, b );
alter table atacc2 add CONSTRAINT x PRIMARY KEY (id, b a);
alter table atacc2 add CONSTRAINT x PRIMARY KEYa (id, b);

tests have problem:
alter table atacc2 add constraints x unique (test, a, b);
ERROR:  syntax error at or near "("
LINE 1: alter table atacc2 add constraints x unique (test, a, b);

          ^
ADD either following with the optional keyword "COLUMN" or
"CONSTRAINT"  as the doc.
so I should expect the '^' point at "constraints"?

It’s finding “… add column_name data_type column_constraint” then dies at the parenthesis.  So indeed the care t should be pointing where it probably is, at the parenthesis that the error is referring to.

David J.

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Synchronizing slots from primary to standby
Next
From: vignesh C
Date:
Subject: Commitfest 2024-01 first week update