Re: Mention column name in error messages - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Mention column name in error messages
Date
Msg-id CA+TgmoavQxwAsnKFxozwHYhn6ogLAkbdiJ9Pgn9F=h1Omx6nJg@mail.gmail.com
Whole thread Raw
In response to Re: Mention column name in error messages  (Franck Verrot <franck@verrot.fr>)
List pgsql-hackers
On Sun, Aug 9, 2015 at 11:44 AM, Franck Verrot <franck@verrot.fr> wrote:
> On Wed, Jul 1, 2015 at 12:30 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> What seems more likely to lead to a usable patch is to arrange for the
>> extra information you want to be emitted as error "context", via an error
>> context callback that gets installed at the right times.  ...
>> ...
>> with no need for int8in to be directly aware of the context.  You should
>> try adapting that methodology for the cases you're worried about.
>
>
> Hi Tom (and others),
>
> Sorry it took so long for me to follow up on this, hopefully I found a
> couple
> a hours today to try writing another patch.
>
> In any case, thanks for reviewing my first attempt and taking time to write
> such a detailed critique... I've learned a lot!
>
> I am now using the error context callback stack. The current column name
> and column type are passed to the callback packed inside  a new structure
> of type "TransformExprState".
> Those information are then passed to `errhint` and will be presented to the
> user later on (in case of coercion failure).
>
>
> Please find the WIP patch attached.
> (I've pushed the patch on my GH fork[1] too).

To make sure this doesn't get forgotten about, you may want to add it here:

https://commitfest.postgresql.org/action/commitfest_view/open

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: GinPageIs* don't actually return a boolean
Next
From: Josh Berkus
Date:
Subject: Re: WIP: SCRAM authentication