pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Rick Otten <rottenwindfish@gmail.com>
Cc: ronan.dunklau@dalibo.com, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: your mail
Date: Tue, 8 Aug 2017 14:19:41 -0700
Message-ID: <20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de> (raw)
In-Reply-To: <17591.1502226734@sss.pgh.pa.us>
References: <20170808194943.smet3uuvtxats44v@alap3.anarazel.de>
	<15541.1502223315@sss.pgh.pa.us>
	<20170808201838.vt5lyujd3fvgtxyq@alap3.anarazel.de>
	<17591.1502226734@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2017-08-08 17:12:14 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2017-08-08 16:15:15 -0400, Tom Lane wrote:
> >> I don't see much of a way to do that in the "typical" case where
> >> the library load happens as a result of a SQL command.  You can't
> >> just say "oh, we're not in a transaction" and then later "wait,
> >> yes we are".
> 
> > Transaction seems hard, but setting CurrentMemoryContext = NULL during
> > library load seems quite possible. And that'll cause a lot of code that
> > assumes an in-progress transaction to fail.
> 
> And it would cause a lot of code that *doesn't* assume that to fail,
> too. That has basically nothing to do with not being in a transaction,
> so I don't think it would be helpful here.

Wouldn't mostsuch code be a bad idea anyway? If it's in transaction
context, you can't rely on the lifetime of allocated memory. If it's
TopMemoryContext, the code should be careful about not leaking.  So
being aware of/explicit about the context used seems advisable.

- Andres


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de>
Permalink:  ../20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de

 · 

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-bugs@postgresql.org
  Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, rottenwindfish@gmail.com, amit.kapila16@gmail.com, robertmhaas@gmail.com
  Subject: Re: your mail
  In-Reply-To: <20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de>
  References: <20170808194943.smet3uuvtxats44v@alap3.anarazel.de> <15541.1502223315@sss.pgh.pa.us> <20170808201838.vt5lyujd3fvgtxyq@alap3.anarazel.de> <17591.1502226734@sss.pgh.pa.us> <20170808211941.p74wtzo5oxt7t5is@alap3.anarazel.de>

* 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