public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: jian he <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: alter table add x wrong error position
Date: Sun, 7 Jan 2024 23:17:38 -0700
Message-ID: <CAKFQuwbs_1ask7XCFFzBu_bKodU=rRy9v5Nn_NBH73zcRNBFcQ@mail.gmail.com> (raw)
In-Reply-To: <CACJufxHU9ZdA=-Q+fg_+v+6OJ-L05rez8_mNZBrKghYD_g04XA@mail.gmail.com>
References: <CACJufxHU9ZdA=-Q+fg_+v+6OJ-L05rez8_mNZBrKghYD_g04XA@mail.gmail.com>

On Sunday, January 7, 2024, jian he <[email protected]> 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.


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: alter table add x wrong error position
  In-Reply-To: <CAKFQuwbs_1ask7XCFFzBu_bKodU=rRy9v5Nn_NBH73zcRNBFcQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox