[patch] [doc] Clarify temporary table name shadowing in CREATE TABLE
Started by David G. Johnstonabout 5 years ago2 messages
Hackers,
Moving this over from -general [1]/messages/by-id/CAKFQuwaM1K=prJNwKnoaC2AyDFn-7OvtCpmQ23bcVe5Z=LKA3Q@mail.gmail.com
David J.
[1]: /messages/by-id/CAKFQuwaM1K=prJNwKnoaC2AyDFn-7OvtCpmQ23bcVe5Z=LKA3Q@mail.gmail.com
/messages/by-id/CAKFQuwaM1K=prJNwKnoaC2AyDFn-7OvtCpmQ23bcVe5Z=LKA3Q@mail.gmail.com
Attachments:
v1-doc-create-table-temp-search-path.txttext/plain; charset=US-ASCII; name=v1-doc-create-table-temp-search-path.txtDownload
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 087cad184c..a400334092 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -171,8 +171,9 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
If specified, the table is created as a temporary table.
Temporary tables are automatically dropped at the end of a
session, or optionally at the end of the current transaction
- (see <literal>ON COMMIT</literal> below). Existing permanent
- tables with the same name are not visible to the current session
+ (see <literal>ON COMMIT</literal> below). The default
+ search_path includes the temporary schema first and so identically
+ named existing permanent tables are not chosen for new plans
while the temporary table exists, unless they are referenced
with schema-qualified names. Any indexes created on a temporary
table are automatically temporary as well.
Re: [patch] [doc] Clarify temporary table name shadowing in CREATE TABLE
On Wed, Oct 21, 2020 at 5:29 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
Hackers,
Moving this over from -general [1]
Applied, thanks!
--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/