Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhjsJ-0003OE-UW for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Sep 2016 20:55:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bhjsJ-0005Jt-Gz for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Sep 2016 20:55:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bhjqu-0002hU-E5 for pgsql-hackers@postgresql.org; Wed, 07 Sep 2016 20:53:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bhjqr-0000js-HP for pgsql-hackers@postgresql.org; Wed, 07 Sep 2016 20:53:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u87KrY73031474; Wed, 7 Sep 2016 16:53:34 -0400 From: Tom Lane To: Dilip Kumar cc: Robert Haas , Amit Kapila , Michael Paquier , Andreas Seltenreich , Piotr Stefaniak , PostgreSQL mailing lists Subject: Re: [sqlsmith] Failed assertion in joinrels.c In-reply-to: References: <87wpxfygg9.fsf@credativ.de> <15630.1438391483@sss.pgh.pa.us> <87614zxroq.fsf@credativ.de> <2086.1438444757@sss.pgh.pa.us> <13027.1438546710@sss.pgh.pa.us> <87egjhv9j8.fsf@credativ.de> <8205.1438906901@sss.pgh.pa.us> <14249.1465054181@sss.pgh.pa.us> <24118.1465136174@sss.pgh.pa.us> <15728.1469809063@sss.pgh.pa.us> <11796.1470179775@sss.pgh.pa.us> Comments: In-reply-to Dilip Kumar message dated "Fri, 26 Aug 2016 14:41:24 +0530" Date: Wed, 07 Sep 2016 16:53:34 -0400 Message-ID: <31473.1473281614@sss.pgh.pa.us> X-Pg-Spam-Score: -3.0 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Dilip Kumar writes: > Basically this patch changes error at three places. > 1. getBaseTypeAndTypmod: This is being called from domain_in exposed > function (domain_in-> > domain_state_setup-> getBaseTypeAndTypmod). Though this function is > being called from many other places which are not exposed function, > but I don't this will have any imapct, will this ? I really don't like this solution. Changing this one function, out of the dozens just like it in lsyscache.c, seems utterly random and arbitrary. I'm actually not especially convinced that passing domain_in a random OID needs to not produce an XX000 error. That isn't a user-facing function and people shouldn't be calling it by hand at all. The same goes for record_in. But if we do want those cases to avoid this, I think it's appropriate to fix it in those functions, not decree that essentially-random other parts of the system should bear the responsibility. (Thought experiment: if we changed the order of operations in domain_in so that getBaseTypeAndTypmod were no longer the first place to fail, would we undo this change and then change wherever the failure had moved to? That's pretty messy.) In the case of record_in, it seems like it'd be easy enough to use lookup_rowtype_tupdesc_noerror() instead of lookup_rowtype_tupdesc() and then throw a user-facing error right there. Not sure about a nice solution for domain_in. We might have to resort to an extra syscache lookup there, but even if we did, it should happen only once per query so that's not very awful. > 3. CheckFunctionValidatorAccess: This is being called from all > language validator functions. This part seems reasonable, since the validator functions are documented as something users might call, and CheckFunctionValidatorAccess seems like an apropos place to handle it. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers