Re: Show expression of virtual columns in error messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Show expression of virtual columns in error messages
Date
Msg-id 719803.1772131627@sss.pgh.pa.us
Whole thread Raw
In response to Re: Show expression of virtual columns in error messages  (Matheus Alcantara <matheusssilv97@gmail.com>)
Responses Re: Show expression of virtual columns in error messages
List pgsql-hackers
Matheus Alcantara <matheusssilv97@gmail.com> writes:
> Attached rebased v3 due to f80bedd52b1. No additional changes compared 
> to v2.

I looked at this and frankly I think it's going in the wrong
direction.  I agree that showing "virtual" is unhelpful, but
I don't like this approach for a couple of reasons:

1. Inserting a column expression could easily make the error
message annoyingly long.

2. Adding this much complexity in an error code path doesn't
seem like a good idea.  Such paths are typically not well
tested, and if there is any bug lurking, it will result in
an error message quite removed from the user's problem.

3. It's making virtual generated columns behave (even more)
differently from stored generated columns.  I think the
general plan has been to make them act as alike as possible.

So what would comport better with the behavior of stored columns
is to show the expression's value.  I agree with you that
calculating that in the error path is a no-go, but haven't we
computed it earlier?  Or could we do so, if there are constraints
to be checked?

            regards, tom lane



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Partial Mode in Aggregate Functions
Next
From: Mahendra Singh Thalor
Date:
Subject: Re: Non-text mode for pg_dumpall