From b89f3cc5c78e7b4c3e10ab39ef527b524d0d112d Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sat, 1 Jan 2022 17:02:30 -0600 Subject: [PATCH 02/11] f!0002-gtt-v64-doc.patch --- doc/src/sgml/ref/create_table.sgml | 42 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 408373323c..9cd5fc17f2 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -174,18 +174,18 @@ WITH ( MODULUS numeric_literal, REM If specified, the table is created as a temporary table. Optionally, GLOBAL or LOCAL - can be written before TEMPORARY or TEMP. + may be written before TEMPORARY or TEMP. They represent two types of temporary tables supported by PostgreSQL: - global temporary table and local temporary table. Without specified - GLOBAL or LOCAL, a local temporary table is created by default. + global temporary table and local temporary table. If neither + GLOBAL or LOCAL is specified, a local temporary table is created by default. - Both types of temporary tables’ data are truncated at the + Data of both types of temporary tables is truncated at the end of a session or optionally at the end of the current transaction. - (see ON COMMIT below). For global temporary table, - its schema is reserved and reused by future sessions or transactions. - For local temporary table, both its data and its schema are dropped. + (see ON COMMIT below). For a global temporary table, + its table definition is preserved and reused by future sessions or transactions. + For a local temporary table, both its data and its table definition are dropped. @@ -194,10 +194,10 @@ WITH ( MODULUS numeric_literal, REM Global temporary table are defined just once and automatically exist - (starting with empty contents) in every session that needs them. - The schema definition of temporary tables is persistent and shared among sessions. - However, the data in temporary tables are kept private to sessions themselves, - even though they use same name and same schema. + (initially with empty contents) in every session. + The schema definition of a temporary table is persistent and common to all sessions. + However, the data in temporary tables is private to each sessions, + even though they share the same name and same table definition. @@ -206,15 +206,15 @@ WITH ( MODULUS numeric_literal, REM Local Temporary Table - Local temporary table are automatically dropped at the end of a - session (include schema and data). Future sessions need to create - their own temporary tables when they are used. + Local temporary tables are automatically dropped at the end of a + session (include table definition and data). Future sessions need to create + their own temporary tables before using them. - 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 + The default search_path includes the temporary schema first, and so + identically-named, permanent tables of the same name as a temporary table are not chosen for new plans + so long as the temporary table exists, unless the permanent table is referenced + with a schema-qualified name. Any indexes created on a temporary table are automatically temporary as well. @@ -229,9 +229,11 @@ WITH ( MODULUS numeric_literal, REM table is going to be used in complex queries, it is wise to run ANALYZE on the temporary table after it is populated. + - The Temporary table resembles the SQL standard, but has some differences. - see below. + The temporary table resembles the behavior defined in the SQL standard, + but has some differences. + See below. -- 2.17.1