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

Commit16f42be

Browse files
committed
Don't allow CREATE TABLE AS to put relations in pg_global.
This was never intended to be allowed, and is blocked for an ordinaryCREATE TABLE, but CREATE TABLE AS slipped through the cracks. Thiscommit won't do anything to fix existing cases where this has loopholehas been exploited, but it still seems prudent to lock it down goingforward.Back-branch commit only, as this problem has been refactored awayon the master branch.Andres Freund
1 parent04e9dc6 commit16f42be

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/backend/executor/execMain.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include"access/xact.h"
4444
#include"catalog/heap.h"
4545
#include"catalog/namespace.h"
46+
#include"catalog/pg_tablespace.h"
4647
#include"catalog/toasting.h"
4748
#include"commands/tablespace.h"
4849
#include"commands/trigger.h"
@@ -2452,6 +2453,12 @@ OpenIntoRel(QueryDesc *queryDesc)
24522453
get_tablespace_name(tablespaceId));
24532454
}
24542455

2456+
/* In all cases disallow placing user relations in pg_global */
2457+
if (tablespaceId==GLOBALTABLESPACE_OID)
2458+
ereport(ERROR,
2459+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2460+
errmsg("only shared relations can be placed in pg_global tablespace")));
2461+
24552462
/* Parse and validate any reloptions */
24562463
reloptions=transformRelOptions((Datum)0,
24572464
into->options,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp