From: Michael Paquier <michael@paquier.xyz>
To: Andreas Karlsson <andreas@proxel.se>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;
Date: Thu, 7 Feb 2019 10:31:35 +0900
Message-ID: <20190207013135.GD4074@paquier.xyz> (raw)
In-Reply-To: <2c6f2b5b-a673-fd1c-ad9c-1c7676cee7d6@proxel.se>
References: <2ddcc188-e37c-a0be-32bf-a56b07c3559e@proxel.se>
<20190206114912.GE14980@paquier.xyz>
<2c6f2b5b-a673-fd1c-ad9c-1c7676cee7d6@proxel.se>
On Wed, Feb 06, 2019 at 04:23:44PM +0100, Andreas Karlsson wrote:
> I added a test in create_table.sql where the test for the other form of CTAS
> IF NOT EXISTS is.
Okay, we can live with that. Instead of a scan on pg_class, I would
have switched to a more simple thing like that for the PREPARE query:
PREPARE select1 AS SELECT 1 AS a;
Then it would be good to add a scan on the created relation after
running all the CREATE TABLE queries to make sure that it remains with
only one tuple.
> I have no idea if something like this should be back patched. I will add it
> to the commit fest either way so it is not lost.
I'd like to get that addressed before working on the other item
reshuffling the CTAS relation creation. Let's wait for a couple of
days and see if folks have objections, and then revisit it at the
beginning of next week. CTAS IF NOT EXISTS is supported down to
9.5 and is documented as such, and my proposal is to back-patch
accordingly.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, andreas@proxel.se, pgsql-hackers@lists.postgresql.org
Subject: Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;
In-Reply-To: <20190207013135.GD4074@paquier.xyz>
* 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