Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
49ce6fff
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
49ce6fff
编写于
6月 18, 2001
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow removal of system-named pg_* temp tables. Rename temp file/dir as
pgsql_tmp.
上级
0bba6bdb
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
51 addition
and
47 deletion
+51
-47
src/backend/catalog/aclchk.c
src/backend/catalog/aclchk.c
+3
-2
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+35
-39
src/backend/storage/file/fd.c
src/backend/storage/file/fd.c
+3
-3
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+4
-2
src/include/utils/temprel.h
src/include/utils/temprel.h
+6
-1
未找到文件。
src/backend/catalog/aclchk.c
浏览文件 @
49ce6fff
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.5
0 2001/06/09 23:21:54 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.5
1 2001/06/18 16:13:21 momjian
Exp $
*
* NOTES
* See acl.h.
...
...
@@ -32,6 +32,7 @@
#include "parser/parse_func.h"
#include "utils/acl.h"
#include "utils/syscache.h"
#include "utils/temprel.h"
static
int32
aclcheck
(
Acl
*
acl
,
AclId
id
,
AclIdType
idtype
,
AclMode
mode
);
...
...
@@ -437,7 +438,7 @@ pg_aclcheck(char *relname, Oid userid, AclMode mode)
*/
if
((
mode
&
(
ACL_INSERT
|
ACL_UPDATE
|
ACL_DELETE
))
&&
!
allowSystemTableMods
&&
IsSystemRelationName
(
relname
)
&&
strncmp
(
relname
,
"pg_temp."
,
strlen
(
"pg_temp."
))
!=
0
&&
!
is_temp_relname
(
relname
)
&&
!
((
Form_pg_shadow
)
GETSTRUCT
(
tuple
))
->
usecatupd
)
{
#ifdef ACLDEBUG
...
...
src/backend/catalog/heap.c
浏览文件 @
49ce6fff
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.16
7 2001/06/12 05:55:49 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.16
8 2001/06/18 16:13:21 momjian
Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -281,8 +281,8 @@ heap_create(char *relname,
* replace relname of caller with a unique name for a temp
* relation
*/
snprintf
(
relname
,
NAMEDATALEN
,
"
pg_temp.%d.
%u"
,
(
int
)
MyProcPid
,
uniqueId
++
);
snprintf
(
relname
,
NAMEDATALEN
,
"
%s_%d_
%u"
,
PG_TEMP_REL_PREFIX
,
(
int
)
MyProcPid
,
uniqueId
++
);
}
/*
...
...
@@ -874,37 +874,6 @@ heap_create_with_catalog(char *relname,
}
/* ----------------------------------------------------------------
* heap_drop_with_catalog - removes all record of named relation from catalogs
*
* 1) open relation, check for existence, etc.
* 2) remove inheritance information
* 3) remove indexes
* 4) remove pg_class tuple
* 5) remove pg_attribute tuples and related descriptions
* 6) remove pg_description tuples
* 7) remove pg_type tuples
* 8) RemoveConstraints ()
* 9) unlink relation
*
* old comments
* Except for vital relations, removes relation from
* relation catalog, and related attributes from
* attribute catalog (needed?). (Anything else?)
*
* get proper relation from relation catalog (if not arg)
* scan attribute catalog deleting attributes of reldesc
* (necessary?)
* delete relation from relation catalog
* (How are the tuples of the relation discarded?)
*
* XXX Must fix to work with indexes.
* There may be a better order for doing things.
* Problems with destroying a deleted database--cannot create
* a struct reldesc without having an open file descriptor.
* ----------------------------------------------------------------
*/
/* --------------------------------
* RelationRemoveInheritance
*
...
...
@@ -1334,10 +1303,35 @@ DeleteTypeTuple(Relation rel)
heap_close
(
pg_type_desc
,
RowExclusiveLock
);
}
/* --------------------------------
* heap_drop_with_catalog
/* --------------------------------
--------------------------------
* heap_drop_with_catalog
- removes all record of named relation from catalogs
*
* --------------------------------
* 1) open relation, check for existence, etc.
* 2) remove inheritance information
* 3) remove indexes
* 4) remove pg_class tuple
* 5) remove pg_attribute tuples and related descriptions
* 6) remove pg_description tuples
* 7) remove pg_type tuples
* 8) RemoveConstraints ()
* 9) unlink relation
*
* old comments
* Except for vital relations, removes relation from
* relation catalog, and related attributes from
* attribute catalog (needed?). (Anything else?)
*
* get proper relation from relation catalog (if not arg)
* scan attribute catalog deleting attributes of reldesc
* (necessary?)
* delete relation from relation catalog
* (How are the tuples of the relation discarded?)
*
* XXX Must fix to work with indexes.
* There may be a better order for doing things.
* Problems with destroying a deleted database--cannot create
* a struct reldesc without having an open file descriptor.
* ----------------------------------------------------------------
*/
void
heap_drop_with_catalog
(
const
char
*
relname
,
...
...
@@ -1360,8 +1354,10 @@ heap_drop_with_catalog(const char *relname,
* prevent deletion of system relations
*/
/* allow temp of pg_class? Guess so. */
if
(
!
istemp
&&
!
allow_system_table_mods
&&
IsSystemRelationName
(
RelationGetRelationName
(
rel
)))
if
(
!
istemp
&&
!
allow_system_table_mods
&&
IsSystemRelationName
(
RelationGetRelationName
(
rel
))
&&
!
is_temp_relname
(
RelationGetRelationName
(
rel
)))
elog
(
ERROR
,
"System relation
\"
%s
\"
may not be dropped"
,
RelationGetRelationName
(
rel
));
...
...
src/backend/storage/file/fd.c
浏览文件 @
49ce6fff
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.8
1 2001/06/11 04:12:29 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.8
2 2001/06/18 16:13:21 momjian
Exp $
*
* NOTES:
*
...
...
@@ -54,8 +54,8 @@
/* Filename components for OpenTemporaryFile */
#define PG_TEMP_FILES_DIR "pg
_tempfiles
"
#define PG_TEMP_FILE_PREFIX "pg
_te
mp"
#define PG_TEMP_FILES_DIR "pg
sql_tmp
"
#define PG_TEMP_FILE_PREFIX "pg
sql_t
mp"
/*
...
...
src/backend/tcop/utility.c
浏览文件 @
49ce6fff
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.11
3 2001/06/09 23:21:54 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.11
4 2001/06/18 16:13:21 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -46,6 +46,7 @@
#include "utils/acl.h"
#include "utils/ps_status.h"
#include "utils/syscache.h"
#include "utils/temprel.h"
#include "access/xlog.h"
/*
...
...
@@ -120,7 +121,8 @@ CheckDropPermissions(char *name, char rightkind)
elog
(
ERROR
,
"you do not own %s
\"
%s
\"
"
,
rentry
->
name
,
name
);
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
name
))
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
name
)
&&
!
is_temp_relname
(
name
))
elog
(
ERROR
,
"%s
\"
%s
\"
is a system %s"
,
rentry
->
name
,
name
,
rentry
->
name
);
...
...
src/include/utils/temprel.h
浏览文件 @
49ce6fff
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: temprel.h,v 1.1
5 2001/03/22 04:01:14
momjian Exp $
* $Id: temprel.h,v 1.1
6 2001/06/18 16:13:21
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -16,6 +16,11 @@
#include "access/htup.h"
#define PG_TEMP_REL_PREFIX "pg_temp"
#define is_temp_relname(relname) \
(strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)) == 0)
extern
void
create_temp_relation
(
const
char
*
relname
,
HeapTuple
pg_class_tuple
);
extern
void
remove_temp_rel_by_relid
(
Oid
relid
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录