Re: some more error location support

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: some more error location support
Date: 2018-08-27 09:17:33
Message-ID: alpine.DEB.2.21.1808271057430.11066@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2018-08-27 09:32:09 Re: has_table_privilege for a table in unprivileged schema causes an error
Previous Message Fabien COELHO 2018-08-27 08:53:58 Re: some more error location support