Re: some more error location support - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: some more error location support
Date
Msg-id alpine.DEB.2.21.1808271031310.11066@lancre
Whole thread Raw
In response to some more error location support  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: some more error location support
List pgsql-hackers
Hello Peter,

> Here are three patches to add more detailed error location support to
> some parts of CREATE TABLE (defaults, check constraints, partition
> specifications) as well as the COPY command.  Examples can be seen in
> the regression test output.
>
> The first two are low-hanging fruit, since all the information was
> already collected and just needed to be passed through one last hop.
> The third one is a bit more invasive; it adds location information to
> the Value node, which is used in a variety of commands, so COPY is just
> a start here.

Patch 1 applies cleanly, compiles, "make check" is okay.

I noticed that you provide NULL from "ALTER TABLE" which is calling the 
create table machinery:

  postgres=# CREATE TABLE foo(id SERIAL CHECK (x = 0));
  ERROR:  column "x" does not exist
  LINE 1: CREATE TABLE foo(id SERIAL CHECK (x = 0));
                                           ^
  postgres=# CREATE TABLE foo();
  CREATE TABLE
  postgres=# ALTER TABLE foo ADD COLUMN id SERIAL CHECK (x = 0);
  ERROR:  column "x" does not exist
  <no location>

Would it be easily possible to provide the query in that case as well?

-- 
Fabien.


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Adding a note to protocol.sgml regarding CopyData
Next
From: Peter Eisentraut
Date:
Subject: Re: some more error location support