Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
72335a20
Commit
72335a20
authored
Jun 09, 2012
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented
parent
37255705
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
6 deletions
+71
-6
src/backend/parser/gram.y
src/backend/parser/gram.y
+50
-6
src/test/regress/expected/create_table.out
src/test/regress/expected/create_table.out
+16
-0
src/test/regress/sql/create_table.sql
src/test/regress/sql/create_table.sql
+5
-0
No files found.
src/backend/parser/gram.y
View file @
72335a20
...
...
@@ -2507,15 +2507,43 @@ CreateStmt: CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')'
* Redundancy here is needed to avoid shift/reduce conflicts,
* since TEMP is not a reserved word. See also OptTempTableName.
*
* NOTE: we accept both GLOBAL and LOCAL options; since we have no modules
* the LOCAL keyword is really meaningless.
* NOTE: we don't accept either the GLOBAL or LOCAL options: not yet implemented.
*/
OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; }
| TEMP { $$ = RELPERSISTENCE_TEMP; }
| LOCAL TEMPORARY { $$ = RELPERSISTENCE_TEMP; }
| LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; }
| GLOBAL TEMPORARY { $$ = RELPERSISTENCE_TEMP; }
| GLOBAL TEMP { $$ = RELPERSISTENCE_TEMP; }
| LOCAL TEMPORARY
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("LOCAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$ = RELPERSISTENCE_TEMP;
}
| LOCAL TEMP
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("LOCAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$ = RELPERSISTENCE_TEMP;
}
| GLOBAL TEMPORARY
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("GLOBAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$ = RELPERSISTENCE_TEMP;
}
| GLOBAL TEMP
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("GLOBAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$ = RELPERSISTENCE_TEMP;
}
| UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; }
| /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; }
;
...
...
@@ -8921,21 +8949,37 @@ OptTempTableName:
| LOCAL TEMPORARY opt_table qualified_name
{
$$ = $4;
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("LOCAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$->relpersistence = RELPERSISTENCE_TEMP;
}
| LOCAL TEMP opt_table qualified_name
{
$$ = $4;
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("LOCAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$->relpersistence = RELPERSISTENCE_TEMP;
}
| GLOBAL TEMPORARY opt_table qualified_name
{
$$ = $4;
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("GLOBAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$->relpersistence = RELPERSISTENCE_TEMP;
}
| GLOBAL TEMP opt_table qualified_name
{
$$ = $4;
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("GLOBAL TEMPORARY not yet implemented"),
parser_errposition(@1)));
$$->relpersistence = RELPERSISTENCE_TEMP;
}
| UNLOGGED opt_table qualified_name
...
...
src/test/regress/expected/create_table.out
View file @
72335a20
...
...
@@ -220,3 +220,19 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "doubly_temp_pkey
CREATE TEMP TABLE public.temp_to_perm (a int primary key); -- not OK
ERROR: cannot create temporary relation in non-temporary schema
DROP TABLE unlogged1, public.unlogged2;
CREATE GLOBAL TEMPORARY TABLE global_temp1 (a int, b text); -- not yet OK
ERROR: GLOBAL TEMPORARY not yet implemented
LINE 1: CREATE GLOBAL TEMPORARY TABLE global_temp1 (a int, b text);
^
CREATE GLOBAL TEMP TABLE global_temp2 (a int, b text); -- not yet OK
ERROR: GLOBAL TEMPORARY not yet implemented
LINE 1: CREATE GLOBAL TEMP TABLE global_temp2 (a int, b text);
^
CREATE LOCAL TEMP TABLE local_temp (a int, b text); -- not yet OK
ERROR: LOCAL TEMPORARY not yet implemented
LINE 1: CREATE LOCAL TEMP TABLE local_temp (a int, b text);
^
CREATE LOCAL TEMP TABLE local_temp (a int, b text); -- not yet OK
ERROR: LOCAL TEMPORARY not yet implemented
LINE 1: CREATE LOCAL TEMP TABLE local_temp (a int, b text);
^
src/test/regress/sql/create_table.sql
View file @
72335a20
...
...
@@ -250,3 +250,8 @@ CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
CREATE
TEMP
TABLE
pg_temp
.
doubly_temp
(
a
int
primary
key
);
-- also OK
CREATE
TEMP
TABLE
public
.
temp_to_perm
(
a
int
primary
key
);
-- not OK
DROP
TABLE
unlogged1
,
public
.
unlogged2
;
CREATE
GLOBAL
TEMPORARY
TABLE
global_temp1
(
a
int
,
b
text
);
-- not yet OK
CREATE
GLOBAL
TEMP
TABLE
global_temp2
(
a
int
,
b
text
);
-- not yet OK
CREATE
LOCAL
TEMP
TABLE
local_temp
(
a
int
,
b
text
);
-- not yet OK
CREATE
LOCAL
TEMP
TABLE
local_temp
(
a
int
,
b
text
);
-- not yet OK
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment