*** a/doc/src/sgml/ref/create_table.sgml
--- b/doc/src/sgml/ref/create_table.sgml
***************
*** 163,169 **** CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI
Optionally, GLOBAL or LOCAL
can be written before TEMPORARY> or TEMP>.
! This makes no difference in PostgreSQL>, but see
.
--- 163,170 ----
Optionally, GLOBAL or LOCAL
can be written before TEMPORARY> or TEMP>.
! This presently makes no difference in PostgreSQL>
! and is deprecated; see
.
***************
*** 1310,1316 **** CREATE TABLE employees OF employee_type (
PostgreSQL does not have.
For compatibility's sake, PostgreSQL will
accept the GLOBAL and LOCAL keywords
! in a temporary table declaration, but they have no effect.
--- 1311,1318 ----
PostgreSQL does not have.
For compatibility's sake, PostgreSQL will
accept the GLOBAL and LOCAL keywords
! in a temporary table declaration, but they have no effect. Use in new
! applications is discouraged.
*** a/src/backend/parser/gram.y
--- b/src/backend/parser/gram.y
***************
*** 2514,2521 **** OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; }
| TEMP { $$ = RELPERSISTENCE_TEMP; }
| LOCAL TEMPORARY { $$ = RELPERSISTENCE_TEMP; }
| LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; }
! | GLOBAL TEMPORARY { $$ = RELPERSISTENCE_TEMP; }
! | GLOBAL TEMP { $$ = RELPERSISTENCE_TEMP; }
| UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; }
| /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; }
;
--- 2514,2533 ----
| TEMP { $$ = RELPERSISTENCE_TEMP; }
| LOCAL TEMPORARY { $$ = RELPERSISTENCE_TEMP; }
| LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; }
! | GLOBAL TEMPORARY
! {
! ereport(WARNING,
! (errmsg("GLOBAL is deprecated in temporary table creation"),
! parser_errposition(@1)));
! $$ = RELPERSISTENCE_TEMP;
! }
! | GLOBAL TEMP
! {
! ereport(WARNING,
! (errmsg("GLOBAL is deprecated in temporary table creation"),
! parser_errposition(@1)));
! $$ = RELPERSISTENCE_TEMP;
! }
| UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; }
| /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; }
;
***************
*** 8930,8940 **** OptTempTableName:
--- 8942,8958 ----
}
| GLOBAL TEMPORARY opt_table qualified_name
{
+ ereport(WARNING,
+ (errmsg("GLOBAL is deprecated in temporary table creation"),
+ parser_errposition(@1)));
$$ = $4;
$$->relpersistence = RELPERSISTENCE_TEMP;
}
| GLOBAL TEMP opt_table qualified_name
{
+ ereport(WARNING,
+ (errmsg("GLOBAL is deprecated in temporary table creation"),
+ parser_errposition(@1)));
$$ = $4;
$$->relpersistence = RELPERSISTENCE_TEMP;
}