Re: [sqlsmith] Failed assertion in joinrels.c - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [sqlsmith] Failed assertion in joinrels.c
Date
Msg-id CA+TgmoY3Fcuh0+_yn-dZza2_Revcz-46-m7Ozcu4Af-Fs_9dtA@mail.gmail.com
Whole thread Raw
In response to Re: [sqlsmith] Failed assertion in joinrels.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [sqlsmith] Failed assertion in joinrels.c  (Peter Geoghegan <pg@heroku.com>)
Re: [sqlsmith] Failed assertion in joinrels.c  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
On Tue, Aug 2, 2016 at 7:16 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Tue, Aug 2, 2016 at 6:03 AM, Dilip Kumar <dilipbalaut@gmail.com> wrote:
>>> There are many more such exposed functions, which can throw cache lookup
>>> failure error if we pass wrong value.
>>>
>>> i.e.
>>> record_in
>>> domain_in
>>> fmgr_c_validator
>>> plpgsql_validator
>>> pg_procedure_is_visible
>>>
>>> Are we planning to change these also..
>
>> I think if they are SQL-callable functions that users can invoke from
>> a SQL prompt, they shouldn't throw "cache lookup failed" errors or,
>> for that matter, any other error that is reported with elog().
>
> FWIW, I would restrict that to "functions that users are *intended* to
> call from a SQL prompt".  If you are fooling around calling internal
> functions with garbage input, you should not be surprised to get an
> internal error back.  So of the above list, only pg_procedure_is_visible
> seems particularly worth changing to me.  And for it, returning NULL
> (ie, "unknown") seems reasonable enough.

I think that's just making life difficult.  If nothing else, sqlsmith
hunts around for functions it can call that return internal errors,
and if we refuse to fix all of them to return user-facing errors, then
it's just crap for the people running sqlsmith to sift through and
it's a judgment call whether to fix each particular case.  Even aside
from that, I think it's much better to have a clear and unambiguous
rule that elog is only for can't-happen things, not
we-don't-recommend-it things.

> There's no such animal as pg_procedure_is_visible.  I suspect that's an
> EDB-ism that hasn't caught up with commit 66bb74dbe8206a35.

Yep.

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Changed SRF in targetlist handling
Next
From: Peter Geoghegan
Date:
Subject: Re: [sqlsmith] Failed assertion in joinrels.c