public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Matheus Alcantara <[email protected]>
Cc: [email protected]
Cc: Peter Eisentraut <[email protected]>
Cc: Yugo Nagata <[email protected]>
Subject: Re: Show expression of virtual columns in error messages
Date: Thu, 26 Feb 2026 13:47:07 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

Matheus Alcantara <[email protected]> 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






view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Show expression of virtual columns in error messages
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox