Re: Problems with Error Messages wrt Domains, Checks

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: john frazer <johnfrazer783(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with Error Messages wrt Domains, Checks
Date: 2018-03-19 21:39:03
Message-ID: CAKFQuwYgV8CLbmV0MaPziKm_Uj2VC37dbzqvLP_3O9QjZLG-3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 19, 2018 at 8:33 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)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

https://www.postgresql.org/message-id/flat/001201ce70d8%24718bd780%2454a38680%24%40kapila%40huawei(dot)com#001201ce70d8$718bd780$54a38680$(at)kapila@huawei.com

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...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-03-19 21:52:22 Re: Problems with Error Messages wrt Domains, Checks
Previous Message Tom Lane 2018-03-19 21:33:35 Re: neqjoinsel versus "refresh materialized view concurrently"