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.1808271057430.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
> 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.

About patch 3: applies cleanly independently of the 2 others, compiles, 
"make check" is okay.

A few comments:

There seems to be several somehow unrelated changes: one about copy,
one about trigger and one about constraints? The two later changes do not 
seem to impact the tests, though.

In "CreateTrigger", you moved "make_parsestate" but removed 
"free_parsestate". I'd rather move it than remove it.

In "value.h", the added location field deserves a "/* token location, or 
-1 if unknown */" comment like others in "parsenode.h", "plannode.h" and 
"primnodes.h".

Copying and comparing values are updaed, but value in/out functions are 
not updated to read/write the location, although other objects have their 
location serialized. ISTM that it should be done as well.

-- 
Fabien.


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: some more error location support
Next
From: Yugo Nagata
Date:
Subject: Re: has_table_privilege for a table in unprivileged schema causesan error