Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jIlYo-0000Y0-T4 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2020 03:58:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jIlYn-00071D-C2 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2020 03:58:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIlYn-000715-50 for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2020 03:58:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIlYi-0001QT-AY for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2020 03:58:00 +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 02U3vo8N024282; Sun, 29 Mar 2020 23:57:50 -0400 From: Tom Lane To: Craig Ringer cc: Andres Freund , Amit Kapila , Michael Paquier , Julien Rouhaud , Masahiko Sawada , PostgreSQL Hackers Subject: Re: Missing errcode() in ereport In-reply-to: References: <20200317095839.GG2206@paquier.xyz> <32174.1584454158@sss.pgh.pa.us> <20200319175902.vjib2tslosw65iyr@alap3.anarazel.de> Comments: In-reply-to Craig Ringer message dated "Mon, 30 Mar 2020 11:54:03 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24280.1585540670.1@sss.pgh.pa.us> Date: Sun, 29 Mar 2020 23:57:50 -0400 Message-ID: <24281.1585540670@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Craig Ringer writes: > I'd have found it helpful to just have the docs explain clearly how it > works by chaining the comma operator using functions with ignored return > values. Want to write some text? > That would also help people understand how they can make parts of an > ereport conditional, e.g. only set errdetail() if there additional info is > currently available W/O duplicating the rest of the ereport . There are examples of that in the tree, of course, but maybe an example in the docs wouldn't be bad either. regards, tom lane