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

Commitd4a6836

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 parent4ba41df commitd4a6836

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
@@ -38,6 +38,7 @@
3838
#include"access/xact.h"
3939
#include"catalog/heap.h"
4040
#include"catalog/namespace.h"
41+
#include"catalog/pg_tablespace.h"
4142
#include"catalog/toasting.h"
4243
#include"commands/tablespace.h"
4344
#include"commands/trigger.h"
@@ -2249,6 +2250,12 @@ OpenIntoRel(QueryDesc *queryDesc)
22492250
get_tablespace_name(tablespaceId));
22502251
}
22512252

2253+
/* In all cases disallow placing user relations in pg_global */
2254+
if (tablespaceId==GLOBALTABLESPACE_OID)
2255+
ereport(ERROR,
2256+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2257+
errmsg("only shared relations can be placed in pg_global tablespace")));
2258+
22522259
/* Parse and validate any reloptions */
22532260
reloptions=transformRelOptions((Datum)0,
22542261
into->options,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp