pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice()
Date: Fri, 26 Aug 2016 10:35:35 -0400
Message-ID: <16610.1472222135@sss.pgh.pa.us> (raw)
In-Reply-To: <23534.1472212411@sss.pgh.pa.us>
References: <A88E0006-13CB-49C6-95CC-1A77D717213C@eggerapps.at>
	<11859.1472139831@sss.pgh.pa.us>
	<CA+Tgmoa8cbvmet4zBjVggbXkq8uZfHnqL2Nxtv_jTVMKiOwCig@mail.gmail.com>
	<15203.1472145555@sss.pgh.pa.us>
	<CA+TgmobD0JZ_cunwBc4e1GZ9AuuZ8UuhYG+F066j+M_bXt-aNw@mail.gmail.com>
	<23534.1472212411@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (15+ messages)  latest in thread

Message-ID: <16610.1472222135@sss.pgh.pa.us>
Permalink:  ../16610.1472222135@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16610.1472222135@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com
  Subject: Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice()
  In-Reply-To: <16610.1472222135@sss.pgh.pa.us>
  References: <A88E0006-13CB-49C6-95CC-1A77D717213C@eggerapps.at> <11859.1472139831@sss.pgh.pa.us> <CA+Tgmoa8cbvmet4zBjVggbXkq8uZfHnqL2Nxtv_jTVMKiOwCig@mail.gmail.com> <15203.1472145555@sss.pgh.pa.us> <CA+TgmobD0JZ_cunwBc4e1GZ9AuuZ8UuhYG+F066j+M_bXt-aNw@mail.gmail.com> <23534.1472212411@sss.pgh.pa.us> <16610.1472222135@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox