Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdIFs-00049i-0A for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Aug 2016 14:37:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bdIFr-0005Cj-B6 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Aug 2016 14:37:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bdIES-00028K-N9 for pgsql-hackers@postgresql.org; Fri, 26 Aug 2016 14:35:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bdIEL-0006gy-4a for pgsql-hackers@postgresql.org; Fri, 26 Aug 2016 14:35:43 +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 u7QEZZ35016611; Fri, 26 Aug 2016 10:35:35 -0400 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice() In-reply-to: <23534.1472212411@sss.pgh.pa.us> References: <11859.1472139831@sss.pgh.pa.us> <15203.1472145555@sss.pgh.pa.us> <23534.1472212411@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 26 Aug 2016 07:53:31 -0400" Date: Fri, 26 Aug 2016 10:35:35 -0400 Message-ID: <16610.1472222135@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) 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 I wrote: > After sleeping on it, I think the right answer is to introduce the new > error-message field (and not worry about 9.5). Will work on a patch > for that, unless I hear objections pretty soon. BTW, while I'm looking at this: what on god's green earth is ThrowErrorData doing copying the supplied data into edata->assoc_context? Surely it should be putting the data into the ErrorContext, where it's not going to get flushed before it can be reported? (Note that in the sole existing use-case, edata->assoc_context is going to have been set to CurrentMemoryContext by pq_parse_errornotice, and I see no good reason to assume that's very long-lived ... in fact, it looks like it's whatever happens to be active when ProcessInterrupts is called, which means there's probably a totally separate set of problems here having to do with potential leaks into long-lived contexts.) I have little use for the name of that function either, as it's not necessarily going to "throw" anything. Maybe ReportErrorUsingData, or something like that? 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