Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
9e3d4c43
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,发现更多精彩内容 >>
提交
9e3d4c43
编写于
11月 06, 1996
作者:
M
Marc G. Fournier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Another directory cleaned up
上级
8544daf6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
383 addition
and
167 deletion
+383
-167
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+274
-33
src/backend/catalog/index.c
src/backend/catalog/index.c
+23
-37
src/backend/catalog/indexing.c
src/backend/catalog/indexing.c
+16
-20
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_aggregate.c
+17
-19
src/backend/catalog/pg_operator.c
src/backend/catalog/pg_operator.c
+14
-17
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_proc.c
+22
-22
src/backend/catalog/pg_type.c
src/backend/catalog/pg_type.c
+17
-19
未找到文件。
src/backend/catalog/heap.c
浏览文件 @
9e3d4c43
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.
5 1996/11/06 06:47:03
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.
6 1996/11/06 07:31:19
scrappy Exp $
*
* INTERFACE ROUTINES
* heap_creatr() - Create an uncataloged heap relation
...
...
@@ -26,6 +26,14 @@
*/
#include <postgres.h>
#include <catalog/pg_ipl.h>
#include <catalog/pg_inherits.h>
#include <catalog/pg_proc.h>
#include <miscadmin.h>
#include <catalog/indexing.h>
#include <catalog/catalog.h>
#include <utils/builtins.h>
#include <access/heapam.h>
#include <utils/mcxt.h>
#include <parser/catalog_utils.h>
#include <catalog/index.h>
...
...
@@ -39,37 +47,11 @@
#include <rewrite/rewriteRemove.h>
#include <storage/lmgr.h>
#include <storage/smgr.h>
#include <access/relscan.h>
#include <utils/tqual.h>
/*
#include <catalog/heap.h>
#include <catalog/pg_proc.h>
#include <parser/catalog_utils.h>
#include <access/heapam.h>
#include <access/genam.h>
#include <access/istrat.h>
#include <storage/bufmgr.h>
#include <lib/hasht.h>
#include <miscadmin.h>
#include <fmgr.h>
#include <utils/builtins.h>
#include <utils/mcxt.h>
#include <utils/relcache.h>
#include <catalog/catname.h>
#include <catalog/pg_index.h>
#include <catalog/pg_inherits.h>
#include <catalog/pg_ipl.h>
#include <catalog/index.h>
#include <catalog/indexing.h>
#include <catalog/catalog.h>
#include <storage/lmgr.h>
#include <rewrite/rewriteRemove.h>
#include <storage/smgr.h>
*/
static
void
AddNewAttributeTuples
(
Oid
new_rel_oid
,
TupleDesc
tupdesc
);
static
void
CheckAttributeNames
(
TupleDesc
tupdesc
);
#ifndef HAVE_MEMMOVE
# include <regex/utils.h>
#else
# include <string.h>
#endif
/* ----------------------------------------------------------------
* XXX UGLY HARD CODED BADNESS FOLLOWS XXX
...
...
@@ -1179,4 +1161,263 @@ DeletePgTypeTuple(Relation rdesc)
/* ----------------
* now scan pg_attribute. if any other relations have
*
attributes
of
the
type
of
the
relation
we
are
de
\ No newline at end of file
* attributes of the type of the relation we are deleteing
* then we have to disallow the deletion. should talk to
* stonebraker about this. -cim 6/19/90
* ----------------
*/
typoid
=
tup
->
t_oid
;
pg_attribute_desc
=
heap_openr
(
AttributeRelationName
);
ScanKeyEntryInitialize
(
&
attkey
,
0
,
Anum_pg_attribute_atttypid
,
F_INT4EQ
,
typoid
);
pg_attribute_scan
=
heap_beginscan
(
pg_attribute_desc
,
0
,
NowTimeQual
,
1
,
&
attkey
);
/* ----------------
* try and get a pg_attribute tuple. if we succeed it means
* we cant delete the relation because something depends on
* the schema.
* ----------------
*/
atttup
=
heap_getnext
(
pg_attribute_scan
,
0
,
(
Buffer
*
)
NULL
);
if
(
PointerIsValid
(
atttup
))
{
Oid
relid
=
((
AttributeTupleForm
)
GETSTRUCT
(
atttup
))
->
attrelid
;
heap_endscan
(
pg_type_scan
);
heap_close
(
pg_type_desc
);
heap_endscan
(
pg_attribute_scan
);
heap_close
(
pg_attribute_desc
);
elog
(
WARN
,
"DeletePgTypeTuple: att of type %s exists in relation %d"
,
&
rdesc
->
rd_rel
->
relname
,
relid
);
}
heap_endscan
(
pg_attribute_scan
);
heap_close
(
pg_attribute_desc
);
/* ----------------
* Ok, it's safe so we delete the relation tuple
* from pg_type and finish up. But first end the scan so that
* we release the read lock on pg_type. -mer 13 Aug 1991
* ----------------
*/
heap_endscan
(
pg_type_scan
);
heap_delete
(
pg_type_desc
,
&
tup
->
t_ctid
);
heap_close
(
pg_type_desc
);
}
/* --------------------------------
* heap_destroy
*
* --------------------------------
*/
void
heap_destroy
(
char
*
relname
)
{
Relation
rdesc
;
/* ----------------
* first open the relation. if the relation does exist,
* heap_openr() returns NULL.
* ----------------
*/
rdesc
=
heap_openr
(
relname
);
if
(
rdesc
==
NULL
)
elog
(
WARN
,
"Relation %s Does Not Exist!"
,
relname
);
/* ----------------
* prevent deletion of system relations
* ----------------
*/
if
(
IsSystemRelationName
(
RelationGetRelationName
(
rdesc
)
->
data
))
elog
(
WARN
,
"amdestroy: cannot destroy %s relation"
,
&
rdesc
->
rd_rel
->
relname
);
/* ----------------
* remove inheritance information
* ----------------
*/
RelationRemoveInheritance
(
rdesc
);
/* ----------------
* remove indexes if necessary
* ----------------
*/
if
(
rdesc
->
rd_rel
->
relhasindex
)
{
RelationRemoveIndexes
(
rdesc
);
}
/* ----------------
* remove rules if necessary
* ----------------
*/
if
(
rdesc
->
rd_rules
!=
NULL
)
{
RelationRemoveRules
(
rdesc
->
rd_id
);
}
/* ----------------
* delete attribute tuples
* ----------------
*/
DeletePgAttributeTuples
(
rdesc
);
/* ----------------
* delete type tuple. here we want to see the effects
* of the deletions we just did, so we use setheapoverride().
* ----------------
*/
setheapoverride
(
true
);
DeletePgTypeTuple
(
rdesc
);
setheapoverride
(
false
);
/* ----------------
* delete relation tuple
* ----------------
*/
DeletePgRelationTuple
(
rdesc
);
/* ----------------
* flush the relation from the relcache
* ----------------
*/
RelationIdInvalidateRelationCacheByRelationId
(
rdesc
->
rd_id
);
/* ----------------
* unlink the relation and finish up.
* ----------------
*/
(
void
)
smgrunlink
(
rdesc
->
rd_rel
->
relsmgr
,
rdesc
);
if
(
rdesc
->
rd_istemp
)
{
rdesc
->
rd_tmpunlinked
=
TRUE
;
}
heap_close
(
rdesc
);
}
/*
* heap_destroyr
* destroy and close temporary relations
*
*/
void
heap_destroyr
(
Relation
rdesc
)
{
ReleaseTmpRelBuffers
(
rdesc
);
(
void
)
smgrunlink
(
rdesc
->
rd_rel
->
relsmgr
,
rdesc
);
if
(
rdesc
->
rd_istemp
)
{
rdesc
->
rd_tmpunlinked
=
TRUE
;
}
heap_close
(
rdesc
);
RemoveFromTempRelList
(
rdesc
);
}
/**************************************************************
functions to deal with the list of temporary relations
**************************************************************/
/* --------------
InitTempRellist():
initialize temporary relations list
the tempRelList is a list of temporary relations that
are created in the course of the transactions
they need to be destroyed properly at the end of the transactions
MODIFIES the global variable tempRels
>> NOTE <<
malloc is used instead of palloc because we KNOW when we are
going to free these things. Keeps us away from the memory context
hairyness
*/
void
InitTempRelList
()
{
if
(
tempRels
)
{
free
(
tempRels
->
rels
);
free
(
tempRels
);
};
tempRels
=
(
TempRelList
*
)
malloc
(
sizeof
(
TempRelList
));
tempRels
->
size
=
TEMP_REL_LIST_SIZE
;
tempRels
->
rels
=
(
Relation
*
)
malloc
(
sizeof
(
Relation
)
*
tempRels
->
size
);
memset
(
tempRels
->
rels
,
0
,
sizeof
(
Relation
)
*
tempRels
->
size
);
tempRels
->
num
=
0
;
}
/*
removes a relation from the TempRelList
MODIFIES the global variable tempRels
we don't really remove it, just mark it as NULL
and DestroyTempRels will look for NULLs
*/
void
RemoveFromTempRelList
(
Relation
r
)
{
int
i
;
if
(
!
tempRels
)
return
;
for
(
i
=
0
;
i
<
tempRels
->
num
;
i
++
)
{
if
(
tempRels
->
rels
[
i
]
==
r
)
{
tempRels
->
rels
[
i
]
=
NULL
;
break
;
}
}
}
/*
add a temporary relation to the TempRelList
MODIFIES the global variable tempRels
*/
void
AddToTempRelList
(
Relation
r
)
{
if
(
!
tempRels
)
return
;
if
(
tempRels
->
num
==
tempRels
->
size
)
{
tempRels
->
size
+=
TEMP_REL_LIST_SIZE
;
tempRels
->
rels
=
realloc
(
tempRels
->
rels
,
tempRels
->
size
);
}
tempRels
->
rels
[
tempRels
->
num
]
=
r
;
tempRels
->
num
++
;
}
/*
go through the tempRels list and destroy each of the relations
*/
void
DestroyTempRels
()
{
int
i
;
Relation
rdesc
;
if
(
!
tempRels
)
return
;
for
(
i
=
0
;
i
<
tempRels
->
num
;
i
++
)
{
rdesc
=
tempRels
->
rels
[
i
];
/* rdesc may be NULL if it has been removed from the list already */
if
(
rdesc
)
heap_destroyr
(
rdesc
);
}
free
(
tempRels
->
rels
);
free
(
tempRels
);
tempRels
=
NULL
;
}
src/backend/catalog/index.c
浏览文件 @
9e3d4c43
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.
6 1996/11/05 11:57:52
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.
7 1996/11/06 07:31:21
scrappy Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -23,47 +23,33 @@
*
*-------------------------------------------------------------------------
*/
#include
"postgres.h"
#include
<postgres.h>
#include <catalog/pg_proc.h>
#include <storage/bufmgr.h>
#include <fmgr.h>
#include <access/genam.h>
#include <access/heapam.h>
#include <utils/builtins.h>
#include <access/xact.h>
#include <parser/catalog_utils.h>
#include <storage/smgr.h>
#include <storage/lmgr.h>
#include <miscadmin.h>
#include <utils/mcxt.h>
#include <utils/relcache.h>
#include <bootstrap/bootstrap.h>
#include <catalog/catname.h>
#include <catalog/catalog.h>
#include <utils/syscache.h>
#include <catalog/indexing.h>
#include <catalog/heap.h>
#include <catalog/index.h>
#include <executor/executor.h>
#include <optimizer/clauses.h>
#include <optimizer/prep.h>
#include <access/istrat.h>
#include "access/genam.h"
#include "access/heapam.h"
#include "utils/builtins.h"
#include "access/xact.h"
#include "parser/catalog_utils.h"
#include "storage/smgr.h"
#include "storage/lmgr.h"
#include "miscadmin.h"
#include "utils/mcxt.h"
#include "utils/palloc.h"
#include "utils/relcache.h"
#include "bootstrap/bootstrap.h"
#include "catalog/catname.h"
#include "catalog/catalog.h"
#include "utils/syscache.h"
#include "catalog/pg_attribute.h"
#include "catalog/pg_class.h"
#include "catalog/indexing.h"
#include "catalog/heap.h"
#include "nodes/plannodes.h"
#include "catalog/index.h"
#include "executor/executor.h"
#include "executor/tuptable.h"
#include "optimizer/clauses.h"
#include "optimizer/prep.h"
#include "access/istrat.h"
#ifndef HAVE_MEMMOVE
# include <regex/utils.h>
#else
...
...
src/backend/catalog/indexing.c
浏览文件 @
9e3d4c43
...
...
@@ -8,30 +8,26 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.
3 1996/11/03 23:27:04
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.
4 1996/11/06 07:31:22
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "utils/builtins.h"
#include "utils/oidcompos.h"
#include "utils/palloc.h"
#include "access/heapam.h"
#include "access/genam.h"
#include "access/skey.h"
#include "storage/bufmgr.h"
#include "nodes/execnodes.h"
#include "catalog/catalog.h"
#include "catalog/catname.h"
#include "catalog/pg_index.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_class.h"
#include "catalog/pg_attribute.h"
#include "utils/syscache.h"
#include "catalog/indexing.h"
#include "catalog/index.h"
#include <postgres.h>
#include "miscadmin.h"
#include <utils/builtins.h>
#include <utils/oidcompos.h>
#include <access/heapam.h>
#include <access/genam.h>
#include <storage/bufmgr.h>
#include <nodes/execnodes.h>
#include <catalog/catalog.h>
#include <catalog/catname.h>
#include <catalog/pg_index.h>
#include <catalog/pg_proc.h>
#include <utils/syscache.h>
#include <catalog/indexing.h>
#include <catalog/index.h>
#include <miscadmin.h>
/*
* Names of indices on the following system catalogs:
...
...
src/backend/catalog/pg_aggregate.c
浏览文件 @
9e3d4c43
...
...
@@ -7,29 +7,27 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.
2 1996/11/03 23:27:05
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.
3 1996/11/06 07:31:23
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include <string.h>
#include "postgres.h"
#include <postgres.h>
#include "access/heapam.h"
#include "access/relscan.h"
#include "access/skey.h"
#include "access/tupdesc.h"
#include "utils/palloc.h"
#include "utils/builtins.h"
#include "fmgr.h"
#include "catalog/catname.h"
#include "utils/syscache.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "catalog/pg_aggregate.h"
#include "miscadmin.h"
#include <access/heapam.h>
#include <utils/builtins.h>
#include <fmgr.h>
#include <catalog/catname.h>
#include <utils/syscache.h>
#include <catalog/pg_operator.h>
#include <catalog/pg_proc.h>
#include <catalog/pg_type.h>
#include <catalog/pg_aggregate.h>
#include <miscadmin.h>
#ifndef HAVE_MEMMOVE
# include <regex/utils.h>
#else
# include <string.h>
#endif
/* ----------------
* AggregateCreate
...
...
src/backend/catalog/pg_operator.c
浏览文件 @
9e3d4c43
...
...
@@ -7,32 +7,29 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.
4 1996/11/05 11:57:53
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.
5 1996/11/06 07:31:24
scrappy Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
*
*-------------------------------------------------------------------------
*/
#include <string.h>
#include "postgres.h"
#include <postgres.h>
#include <catalog/pg_proc.h>
#include <utils/syscache.h>
#include "access/heapam.h"
#include "access/skey.h"
#include "access/htup.h"
#include "utils/palloc.h"
#include "parser/catalog_utils.h"
#include "catalog/catname.h"
#include "catalog/pg_operator.h"
#include "storage/bufmgr.h"
#include "fmgr.h"
#include "miscadmin.h"
#include <access/heapam.h>
#include <parser/catalog_utils.h>
#include <catalog/catname.h>
#include <catalog/pg_operator.h>
#include <storage/bufmgr.h>
#include <fmgr.h>
#include <miscadmin.h>
#ifndef HAVE_MEMMOVE
# include <regex/utils.h>
#else
# include <string.h>
#endif
static
Oid
OperatorGetWithOpenRelation
(
Relation
pg_operator_desc
,
const
char
*
operatorName
,
...
...
src/backend/catalog/pg_proc.c
浏览文件 @
9e3d4c43
...
...
@@ -7,33 +7,33 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.
3 1996/11/05 11:57:54
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.
4 1996/11/06 07:31:25
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include <
string
.h>
#include "postgres.h"
#include <
postgres
.h>
#include <utils/syscache.h>
#include <catalog/pg_proc.h>
#include
"access/heapam.h"
#include
"access/relscan.h"
#include
"access/skey.h"
#include
"fmgr.h"
#include
"utils/builtins.h"
#include
"utils/sets.h"
#include
"catalog/catname.h"
#include
"catalog/indexing.h"
#include
"parser/parse_query.h"
#include
"tcop/tcopprot.h"
#include
"parser/catalog_utils.h"
#include
"optimizer/internal.h"
#i
nclude "optimizer/planner.h"
#
include "utils/lsyscache.h"
#
include "miscadmin.h"
#include <access/heapam.h>
#include
<access/relscan.h>
#include
<fmgr.h>
#include
<utils/builtins.h>
#include
<utils/sets.h>
#include
<catalog/catname.h>
#include
<catalog/indexing.h>
#include <parser/parse_query.h>
#include
<tcop/tcopprot.h>
#include
<parser/catalog_utils.h>
#include
<optimizer/internal.h>
#include
<optimizer/planner.h>
#include
<utils/lsyscache.h>
#include
<miscadmin.h>
#i
fndef HAVE_MEMMOVE
# include <regex/utils.h>
#
else
# include <string.h>
#
endif
/* ----------------------------------------------------------------
* ProcedureDefine
...
...
src/backend/catalog/pg_type.c
浏览文件 @
9e3d4c43
...
...
@@ -7,30 +7,28 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.
3 1996/11/05 11:57:55
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.
4 1996/11/06 07:31:26
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include <
string
.h>
#include "postgres.h"
#include <
postgres
.h>
#include <utils/syscache.h>
#include <catalog/pg_proc.h>
#include "access/heapam.h"
#include "access/relscan.h"
#include "access/skey.h"
#include "access/tupdesc.h"
#include "utils/builtins.h"
#include "utils/palloc.h"
#include "fmgr.h"
#include "parser/catalog_utils.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "storage/lmgr.h"
#include "miscadmin.h"
#include <access/heapam.h>
#include <access/relscan.h>
#include <utils/builtins.h>
#include <fmgr.h>
#include <parser/catalog_utils.h>
#include <catalog/catname.h>
#include <catalog/indexing.h>
#include <storage/lmgr.h>
#include <miscadmin.h>
#ifndef HAVE_MEMMOVE
# include <regex/utils.h>
#else
# include <string.h>
#endif
/* ----------------------------------------------------------------
* TypeGetWithOpenRelation
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录