Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
72335a20
Commit
72335a20
authored
12 years ago
by
Simon Riggs
Browse files
Options
Downloads
Patches
Plain Diff
Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented
parent
37255705
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/parser/gram.y
+50
-6
50 additions, 6 deletions
src/backend/parser/gram.y
src/test/regress/expected/create_table.out
+16
-0
16 additions, 0 deletions
src/test/regress/expected/create_table.out
src/test/regress/sql/create_table.sql
+5
-0
5 additions, 0 deletions
src/test/regress/sql/create_table.sql
with
71 additions
and
6 deletions
src/backend/parser/gram.y
+
50
−
6
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
...
...
This diff is collapsed.
Click to expand it.
src/test/regress/expected/create_table.out
+
16
−
0
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);
^
This diff is collapsed.
Click to expand it.
src/test/regress/sql/create_table.sql
+
5
−
0
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment