From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Thom Brown <thom@linux.com>
Cc: Dimitri Fontaine <dimitri@2ndquadrant.fr>
Subject: Re: Command Triggers, patch v11
Date: Sun, 18 Mar 2012 20:12:03 +0100
Message-ID: <m2ty1loha4.fsf@2ndQuadrant.fr> (raw)
In-Reply-To: <18353.1332095370@sss.pgh.pa.us>
References: <m24nufq466.fsf@2ndQuadrant.fr>
<9503.1332006327@sss.pgh.pa.us>
<24814.1332021870@sss.pgh.pa.us>
<201203172326.53461.andres@anarazel.de>
<18353.1332095370@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> writes:
> 1. ExecuteQuery still has to know that's a CREATE TABLE AS operation so
> that it can enforce that the prepared query is a SELECT. (BTW, maybe
> this should be weakened to "something that returns tuples", in view of
> RETURNING?)
That lights a bulb: what about rewriting CREATE TABLE AS as two
commands, internally:
1. CREATE TABLE …
2. WITH x ( <query here> ) INSERT INTO … SELECT * FROM x;
It seems like not solving much from a practical point of view though as
you need to be able to parse the output of the subquery before you can
do the first step, but on the other hand it might be that you already
have the pieces to just do that.
Well, I had to share that though, somehow.
Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: dimitri@2ndQuadrant.fr, tgl@sss.pgh.pa.us, andres@anarazel.de, thom@linux.com
Subject: Re: Command Triggers, patch v11
In-Reply-To: <m2ty1loha4.fsf@2ndQuadrant.fr>
* 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