Re: Problems with Error Messages wrt Domains, Checks - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Problems with Error Messages wrt Domains, Checks
Date
Msg-id CAKFQuwYgV8CLbmV0MaPziKm_Uj2VC37dbzqvLP_3O9QjZLG-3g@mail.gmail.com
Whole thread Raw
In response to Re: Problems with Error Messages wrt Domains, Checks  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Problems with Error Messages wrt Domains, Checks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Mar 19, 2018 at 8:33 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Frankly, I'm not seeing "invalid constant regular expressions" as being a
> large scale problem - but I'll agree that having the error include the
> actual literal being parsed as a RegEx should be done.

Agreed.  Doing anything about the other stuff discussed in this thread is
fairly large-scale work, but adjusting our regex error messages is easy.

​Another one that seems to fall into the "fairly large-scale work" would be the:

​ERROR:  more than one row returned by a subquery used as an expression
(that's it, nothing else prints in psql when I run the offending query - using "--echo-all" to at least see what query I sent caused the issue)

Found this via Google


Printing out the offending expression would be nice if possible - printing the set (size > 1) of values that were returned would probably help as well, though usually the problem data is in a where clause while the set would contain target list data - and its those where clause items that matter more.  In the case of a correlated subquery exhibiting this problem the outer query vars being passed in is what would be most helpful.

David J.

P.S. I consider this to be on-topic to the general "hard to debug" topic this thread covers even if its doesn't involve domains...I may gripe more prominently later...

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: neqjoinsel versus "refresh materialized view concurrently"
Next
From: Tom Lane
Date:
Subject: Re: Problems with Error Messages wrt Domains, Checks