public inbox for [email protected]
help / color / mirror / Atom feedFrom: Bruce Momjian <[email protected]>
To: David G. Johnston <[email protected]>
Cc: [email protected]
Cc: Pg Docs <[email protected]>
Subject: Re: CREATE TABLE AS, section IF NOT EXISTS should clarify what happens to the data
Date: Mon, 18 Jul 2022 15:43:03 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwY30ro-xosyLZc=qFO3UhnudwvHO4oOJDqGawdQrtUWSA@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<CAKFQuwY30ro-xosyLZc=qFO3UhnudwvHO4oOJDqGawdQrtUWSA@mail.gmail.com>
fOn Thu, Jul 14, 2022 at 06:47:19PM -0700, David G. Johnston wrote:
> Not only is the existing table not modified, I think that the select query
> portion of the command is never even executed. That would seem to be useful
> knowledge to have.
>
> Maybe something like:
>
> <para>
> Do not throw an error if a relation with the same name already exists.
> A notice is issued in this case.
> If <literal>WITH DATA</literal> is specified (the default) the execution of
> the parsed query does not happen, leaving the existing table with its existing
> contents.
> </para>
I tried to go in that direction, but couldn't clearly name the
SELECT/VALUES part of the CREATE TABLE AS query because CREATE TABLE
AS is also a query. I felt trying to say we ran the CREATE TABLE AS
query but not the SELECT/VALUES of the query was just too confusing. I
used "simply issue a notice" as implying that nothing else happens,
which I considered sufficient.
>
> I've removed the xref to create table as there is nothing additional there of
> material benefit - the sentence:
Okay, removed. Updated patch attached.
--
Bruce Momjian <[email protected]> https://momjian.us
EDB https://enterprisedb.com
Indecision is a decision. Inaction is an action. Mark Batterson
Attachments:
[text/x-diff] exists.diff (767B, 2-exists.diff)
download | inline diff:
diff --git a/doc/src/sgml/ref/create_table_as.sgml b/doc/src/sgml/ref/create_table_as.sgml
index 07558ab56c..8429333e3a 100644
--- a/doc/src/sgml/ref/create_table_as.sgml
+++ b/doc/src/sgml/ref/create_table_as.sgml
@@ -100,9 +100,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI
<term><literal>IF NOT EXISTS</literal></term>
<listitem>
<para>
- Do not throw an error if a relation with the same name already exists.
- A notice is issued in this case. Refer to <xref linkend="sql-createtable"/>
- for details.
+ Do not throw an error if a relation with the same name already
+ exists; simply issue a notice and leave the table unmodified.
</para>
</listitem>
</varlistentry>
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: CREATE TABLE AS, section IF NOT EXISTS should clarify what happens to the data
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox