pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bernd Helmle <mailings@oopsware.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Sven Wegener <sven.wegener@stealer.net>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql-general@postgresql.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: [GENERAL] Re: [BUGS] COPY TO returning empty result with parallel ALTER TABLE
Date: Wed, 05 Nov 2014 00:14:42 +0100
Message-ID: <FF3CF50F040B5D1AE1381AB1@localhost> (raw)
In-Reply-To: <20002.1415139494@sss.pgh.pa.us>
References: <alpine.LNX.2.11.1411031751320.29849@titan.int.lan.stealer.net>
	<D19B4DF60D3D403C6E7B61D6@eje.credativ.lan>
	<12887.1415127083@sss.pgh.pa.us>
	<20141104200328.GR28295@alap3.anarazel.de>
	<20002.1415139494@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



--On 4. November 2014 17:18:14 -0500 Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Yeah, and I think that it's entirely reasonable for rewriting ALTER TABLEs
> to update the xmin of the rewritten tuples; after all, the output data
> could be arbitrarily different from what the previous transactions put
> into the table.  But that is not the question here.  If the COPY blocks
> until the ALTER completes --- as it must --- why is its execution snapshot
> not taken *after* the lock is acquired?

COPY waits in DoCopy() but its snapshot gets acquired in PortalRunUtility() 
earlier. SELECT has it's lock already during transform/analyse phase and 
its snapshot is taken much later.  Looks like we need something that 
analyses a utility statement to get its lock before executing.

-- 
Thanks

	Bernd


-- 
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 (9+ messages)

Message-ID: <FF3CF50F040B5D1AE1381AB1@localhost>
Permalink:  ../FF3CF50F040B5D1AE1381AB1@localhost/
Also on:    postgresql.org/message-id/FF3CF50F040B5D1AE1381AB1@localhost

 · 

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: mailings@oopsware.de, tgl@sss.pgh.pa.us, andres@2ndquadrant.com, sven.wegener@stealer.net, pgsql-hackers@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] Re: [BUGS] COPY TO returning empty result with parallel ALTER TABLE
  In-Reply-To: <FF3CF50F040B5D1AE1381AB1@localhost>
  References: <alpine.LNX.2.11.1411031751320.29849@titan.int.lan.stealer.net> <D19B4DF60D3D403C6E7B61D6@eje.credativ.lan> <12887.1415127083@sss.pgh.pa.us> <20141104200328.GR28295@alap3.anarazel.de> <20002.1415139494@sss.pgh.pa.us> <FF3CF50F040B5D1AE1381AB1@localhost>

* 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