Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72335a2

Browse files
Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented
1 parent3725570 commit72335a2

File tree

3 files changed

+71
-6
lines changed

3 files changed

+71
-6
lines changed

‎src/backend/parser/gram.y

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,15 +2507,43 @@ CreateStmt:CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')'
25072507
* Redundancy here is needed to avoid shift/reduce conflicts,
25082508
* since TEMP is not a reserved word. See also OptTempTableName.
25092509
*
2510-
* NOTE: we accept both GLOBAL and LOCAL options; since we have no modules
2511-
* the LOCAL keyword is really meaningless.
2510+
* NOTE: we don't accept either the GLOBAL or LOCAL options: not yet implemented.
25122511
*/
25132512
OptTemp:TEMPORARY{$$ = RELPERSISTENCE_TEMP; }
25142513
|TEMP{$$ = RELPERSISTENCE_TEMP; }
2515-
|LOCALTEMPORARY{$$ = RELPERSISTENCE_TEMP; }
2516-
|LOCALTEMP{$$ = RELPERSISTENCE_TEMP; }
2517-
|GLOBALTEMPORARY{$$ = RELPERSISTENCE_TEMP; }
2518-
|GLOBALTEMP{$$ = RELPERSISTENCE_TEMP; }
2514+
|LOCALTEMPORARY
2515+
{
2516+
ereport(ERROR,
2517+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2518+
errmsg("LOCAL TEMPORARY not yet implemented"),
2519+
parser_errposition(@1)));
2520+
$$ = RELPERSISTENCE_TEMP;
2521+
}
2522+
|LOCALTEMP
2523+
{
2524+
ereport(ERROR,
2525+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2526+
errmsg("LOCAL TEMPORARY not yet implemented"),
2527+
parser_errposition(@1)));
2528+
$$ = RELPERSISTENCE_TEMP;
2529+
}
2530+
|GLOBALTEMPORARY
2531+
{
2532+
ereport(ERROR,
2533+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2534+
errmsg("GLOBAL TEMPORARY not yet implemented"),
2535+
parser_errposition(@1)));
2536+
$$ = RELPERSISTENCE_TEMP;
2537+
}
2538+
|GLOBALTEMP
2539+
{
2540+
ereport(ERROR,
2541+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2542+
errmsg("GLOBAL TEMPORARY not yet implemented"),
2543+
parser_errposition(@1)));
2544+
$$ = RELPERSISTENCE_TEMP;
2545+
}
2546+
25192547
|UNLOGGED{$$ = RELPERSISTENCE_UNLOGGED; }
25202548
|/*EMPTY*/{$$ = RELPERSISTENCE_PERMANENT; }
25212549
;
@@ -8921,21 +8949,37 @@ OptTempTableName:
89218949
|LOCALTEMPORARYopt_tablequalified_name
89228950
{
89238951
$$ =$4;
8952+
ereport(ERROR,
8953+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
8954+
errmsg("LOCAL TEMPORARY not yet implemented"),
8955+
parser_errposition(@1)));
89248956
$$->relpersistence = RELPERSISTENCE_TEMP;
89258957
}
89268958
|LOCALTEMPopt_tablequalified_name
89278959
{
89288960
$$ =$4;
8961+
ereport(ERROR,
8962+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
8963+
errmsg("LOCAL TEMPORARY not yet implemented"),
8964+
parser_errposition(@1)));
89298965
$$->relpersistence = RELPERSISTENCE_TEMP;
89308966
}
89318967
|GLOBALTEMPORARYopt_tablequalified_name
89328968
{
89338969
$$ =$4;
8970+
ereport(ERROR,
8971+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
8972+
errmsg("GLOBAL TEMPORARY not yet implemented"),
8973+
parser_errposition(@1)));
89348974
$$->relpersistence = RELPERSISTENCE_TEMP;
89358975
}
89368976
|GLOBALTEMPopt_tablequalified_name
89378977
{
89388978
$$ =$4;
8979+
ereport(ERROR,
8980+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
8981+
errmsg("GLOBAL TEMPORARY not yet implemented"),
8982+
parser_errposition(@1)));
89398983
$$->relpersistence = RELPERSISTENCE_TEMP;
89408984
}
89418985
|UNLOGGEDopt_tablequalified_name

‎src/test/regress/expected/create_table.out

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,19 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "doubly_temp_pkey
220220
CREATE TEMP TABLE public.temp_to_perm (a int primary key);-- not OK
221221
ERROR: cannot create temporary relation in non-temporary schema
222222
DROP TABLE unlogged1, public.unlogged2;
223+
CREATE GLOBAL TEMPORARY TABLE global_temp1 (a int, b text);-- not yet OK
224+
ERROR: GLOBAL TEMPORARY not yet implemented
225+
LINE 1: CREATE GLOBAL TEMPORARY TABLE global_temp1 (a int, b text);
226+
^
227+
CREATE GLOBAL TEMP TABLE global_temp2 (a int, b text);-- not yet OK
228+
ERROR: GLOBAL TEMPORARY not yet implemented
229+
LINE 1: CREATE GLOBAL TEMP TABLE global_temp2 (a int, b text);
230+
^
231+
CREATE LOCAL TEMP TABLE local_temp (a int, b text);-- not yet OK
232+
ERROR: LOCAL TEMPORARY not yet implemented
233+
LINE 1: CREATE LOCAL TEMP TABLE local_temp (a int, b text);
234+
^
235+
CREATE LOCAL TEMP TABLE local_temp (a int, b text);-- not yet OK
236+
ERROR: LOCAL TEMPORARY not yet implemented
237+
LINE 1: CREATE LOCAL TEMP TABLE local_temp (a int, b text);
238+
^

‎src/test/regress/sql/create_table.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,8 @@ CREATE TEMP TABLE explicitly_temp (a int primary key);-- also OK
250250
CREATE TEMP TABLEpg_temp.doubly_temp (aintprimary key);-- also OK
251251
CREATE TEMP TABLEpublic.temp_to_perm (aintprimary key);-- not OK
252252
DROPTABLE unlogged1,public.unlogged2;
253+
254+
CREATE GLOBAL TEMPORARY TABLE global_temp1 (aint, btext);-- not yet OK
255+
CREATE GLOBAL TEMP TABLE global_temp2 (aint, btext);-- not yet OK
256+
CREATE LOCAL TEMP TABLE local_temp (aint, btext);-- not yet OK
257+
CREATE LOCAL TEMP TABLE local_temp (aint, btext);-- not yet OK

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp