Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c445ba33
Commit
c445ba33
authored
Nov 28, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename heap_create to heap_create_and_catatlog, rename heap_creatr to heap_create().
parent
a8926e04
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
52 additions
and
50 deletions
+52
-50
src/backend/bootstrap/bootparse.y
src/backend/bootstrap/bootparse.y
+4
-4
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+20
-19
src/backend/catalog/index.c
src/backend/catalog/index.c
+2
-2
src/backend/commands/cluster.c
src/backend/commands/cluster.c
+4
-4
src/backend/commands/creatinh.c
src/backend/commands/creatinh.c
+2
-2
src/backend/commands/recipe.c
src/backend/commands/recipe.c
+5
-4
src/backend/executor/execAmi.c
src/backend/executor/execAmi.c
+3
-3
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+2
-2
src/backend/executor/nodeTee.c
src/backend/executor/nodeTee.c
+5
-5
src/backend/storage/large_object/inv_api.c
src/backend/storage/large_object/inv_api.c
+2
-2
src/include/catalog/heap.h
src/include/catalog/heap.h
+3
-3
No files found.
src/backend/bootstrap/bootparse.y
View file @
c445ba33
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.
7 1997/11/24 05:07:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.
8 1997/11/28 04:39:25
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -170,7 +170,7 @@ CreateStmt:
...
@@ -170,7 +170,7 @@ CreateStmt:
if (DebugMode)
if (DebugMode)
puts("creating bootstrap relation");
puts("creating bootstrap relation");
tupdesc = CreateTupleDesc(numattr,attrtypes);
tupdesc = CreateTupleDesc(numattr,attrtypes);
reldesc = heap_creat
r
(LexIDStr($3), tupdesc);
reldesc = heap_creat
e
(LexIDStr($3), tupdesc);
if (DebugMode)
if (DebugMode)
puts("bootstrap relation created ok");
puts("bootstrap relation created ok");
}
}
...
@@ -178,10 +178,10 @@ CreateStmt:
...
@@ -178,10 +178,10 @@ CreateStmt:
{
{
Oid id;
Oid id;
TupleDesc tupdesc;
TupleDesc tupdesc;
/* extern Oid heap_create();*/
/* extern Oid heap_create
_and_catalog
();*/
tupdesc = CreateTupleDesc(numattr,attrtypes);
tupdesc = CreateTupleDesc(numattr,attrtypes);
id = heap_create(LexIDStr($3), tupdesc);
id = heap_create
_and_catalog
(LexIDStr($3), tupdesc);
if (!Quiet)
if (!Quiet)
printf("CREATED relation %s with OID %d\n",
printf("CREATED relation %s with OID %d\n",
LexIDStr($3), id);
LexIDStr($3), id);
...
...
src/backend/catalog/heap.c
View file @
c445ba33
...
@@ -7,17 +7,18 @@
...
@@ -7,17 +7,18 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.3
7 1997/11/26 04:50:19
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.3
8 1997/11/28 04:39:34
momjian Exp $
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
* heap_creat
r
() - Create an uncataloged heap relation
* heap_creat
e
() - Create an uncataloged heap relation
* heap_create
()
- Create a cataloged relation
* heap_create
_and_catalog()
- Create a cataloged relation
* heap_destroy() - Removes named relation from catalogs
* heap_destroy() - Removes named relation from catalogs
*
*
* NOTES
* NOTES
* this code taken from access/heap/create.c, which contains
* this code taken from access/heap/create.c, which contains
* the old heap_creater, amcreate, and amdestroy. those routines
* the old heap_create_and_catalogr, amcreate, and amdestroy.
* will soon call these routines using the function manager,
* those routines will soon call these routines using the function
* manager,
* just like the poorly named "NewXXX" routines do. The
* just like the poorly named "NewXXX" routines do. The
* "New" routines are all going to die soon, once and for all!
* "New" routines are all going to die soon, once and for all!
* -cim 1/13/91
* -cim 1/13/91
...
@@ -148,7 +149,7 @@ static TempRelList *tempRels = NULL;
...
@@ -148,7 +149,7 @@ static TempRelList *tempRels = NULL;
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* heap_creat
r
- Create an uncataloged heap relation
* heap_creat
e
- Create an uncataloged heap relation
*
*
* Fields relpages, reltuples, reltuples, relkeys, relhistory,
* Fields relpages, reltuples, reltuples, relkeys, relhistory,
* relisindexed, and relkind of rdesc->rd_rel are initialized
* relisindexed, and relkind of rdesc->rd_rel are initialized
...
@@ -160,12 +161,12 @@ static TempRelList *tempRels = NULL;
...
@@ -160,12 +161,12 @@ static TempRelList *tempRels = NULL;
* into the transaction context block.
* into the transaction context block.
*
*
*
*
* if heap_creat
r is called with "" as the name, then heap_creatr will create a
* if heap_creat
e is called with "" as the name, then heap_create will create
* temporary name "temp_$RELOID" for the relation
*
a
temporary name "temp_$RELOID" for the relation
* ----------------------------------------------------------------
* ----------------------------------------------------------------
*/
*/
Relation
Relation
heap_creat
r
(
char
*
name
,
heap_creat
e
(
char
*
name
,
TupleDesc
tupDesc
)
TupleDesc
tupDesc
)
{
{
register
unsigned
i
;
register
unsigned
i
;
...
@@ -331,7 +332,7 @@ heap_creatr(char *name,
...
@@ -331,7 +332,7 @@ heap_creatr(char *name,
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* heap_create - Create a cataloged relation
* heap_create
_and_catalog
- Create a cataloged relation
*
*
* this is done in 6 steps:
* this is done in 6 steps:
*
*
...
@@ -342,8 +343,8 @@ heap_creatr(char *name,
...
@@ -342,8 +343,8 @@ heap_creatr(char *name,
* preforms a scan to ensure that no relation with the
* preforms a scan to ensure that no relation with the
* same name already exists.
* same name already exists.
*
*
* 3) heap_create
r() is called to create the new relation
on
* 3) heap_create
_and_catalogr() is called to create the new relati
on
* disk.
*
on
disk.
*
*
* 4) TypeDefine() is called to define a new type corresponding
* 4) TypeDefine() is called to define a new type corresponding
* to the new relation.
* to the new relation.
...
@@ -375,8 +376,8 @@ heap_creatr(char *name,
...
@@ -375,8 +376,8 @@ heap_creatr(char *name,
* create new relation
* create new relation
* insert new relation into attribute catalog
* insert new relation into attribute catalog
*
*
* Should coordinate with heap_create
r(). Either it should
* Should coordinate with heap_create
_and_catalogr(). Either
* not be called or there should be a way to prevent
*
it should
not be called or there should be a way to prevent
* the relation from being removed at the end of the
* the relation from being removed at the end of the
* transaction if it is successful ('u'/'r' may be enough).
* transaction if it is successful ('u'/'r' may be enough).
* Also, if the transaction does not commit, then the
* Also, if the transaction does not commit, then the
...
@@ -738,14 +739,14 @@ addNewRelationType(char *typeName, Oid new_rel_oid)
...
@@ -738,14 +739,14 @@ addNewRelationType(char *typeName, Oid new_rel_oid)
}
}
/* --------------------------------
/* --------------------------------
* heap_create
* heap_create
_and_catalog
*
*
* creates a new cataloged relation. see comments above.
* creates a new cataloged relation. see comments above.
* --------------------------------
* --------------------------------
*/
*/
Oid
Oid
heap_create
(
char
relname
[],
heap_create
_and_catalog
(
char
relname
[],
TupleDesc
tupdesc
)
TupleDesc
tupdesc
)
{
{
Relation
pg_class_desc
;
Relation
pg_class_desc
;
Relation
new_rel_desc
;
Relation
new_rel_desc
;
...
@@ -782,11 +783,11 @@ heap_create(char relname[],
...
@@ -782,11 +783,11 @@ heap_create(char relname[],
* create an uncataloged relation and pull its relation oid
* create an uncataloged relation and pull its relation oid
* from the newly formed relation descriptor.
* from the newly formed relation descriptor.
*
*
* Note: The call to heap_creat
r
() does all the "real" work
* Note: The call to heap_creat
e
() does all the "real" work
* of creating the disk file for the relation.
* of creating the disk file for the relation.
* ----------------
* ----------------
*/
*/
new_rel_desc
=
heap_creat
r
(
relname
,
tupdesc
);
new_rel_desc
=
heap_creat
e
(
relname
,
tupdesc
);
new_rel_oid
=
new_rel_desc
->
rd_att
->
attrs
[
0
]
->
attrelid
;
new_rel_oid
=
new_rel_desc
->
rd_att
->
attrs
[
0
]
->
attrelid
;
/* ----------------
/* ----------------
...
...
src/backend/catalog/index.c
View file @
c445ba33
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.3
0 1997/11/25 21:58:43
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.3
1 1997/11/28 04:39:38
momjian Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -1120,7 +1120,7 @@ index_create(char *heapRelationName,
...
@@ -1120,7 +1120,7 @@ index_create(char *heapRelationName,
* create the index relation
* create the index relation
* ----------------
* ----------------
*/
*/
indexRelation
=
heap_creat
r
(
indexRelationName
,
indexRelation
=
heap_creat
e
(
indexRelationName
,
indexTupDesc
);
indexTupDesc
);
/* ----------------
/* ----------------
...
...
src/backend/commands/cluster.c
View file @
c445ba33
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.1
7 1997/11/21 18:09:46
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.1
8 1997/11/28 04:39:43
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -209,13 +209,13 @@ copy_heap(Oid OIDOldHeap)
...
@@ -209,13 +209,13 @@ copy_heap(Oid OIDOldHeap)
OldHeapDesc
=
RelationGetTupleDescriptor
(
OldHeap
);
OldHeapDesc
=
RelationGetTupleDescriptor
(
OldHeap
);
/*
/*
* Need to make a copy of the tuple descriptor, heap_create
modifies
* Need to make a copy of the tuple descriptor, heap_create
_and_catalog
* it.
*
modifies
it.
*/
*/
tupdesc
=
CreateTupleDescCopy
(
OldHeapDesc
);
tupdesc
=
CreateTupleDescCopy
(
OldHeapDesc
);
OIDNewHeap
=
heap_create
(
NewName
,
tupdesc
);
OIDNewHeap
=
heap_create
_and_catalog
(
NewName
,
tupdesc
);
if
(
!
OidIsValid
(
OIDNewHeap
))
if
(
!
OidIsValid
(
OIDNewHeap
))
elog
(
WARN
,
"clusterheap: cannot create temporary heap relation
\n
"
);
elog
(
WARN
,
"clusterheap: cannot create temporary heap relation
\n
"
);
...
...
src/backend/commands/creatinh.c
View file @
c445ba33
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.
19 1997/11/21 18:09:49
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.
20 1997/11/28 04:39:48
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -137,7 +137,7 @@ DefineRelation(CreateStmt *stmt)
...
@@ -137,7 +137,7 @@ DefineRelation(CreateStmt *stmt)
}
}
}
}
relationId
=
heap_create
(
relname
,
descriptor
);
relationId
=
heap_create
_and_catalog
(
relname
,
descriptor
);
StoreCatalogInheritance
(
relationId
,
inheritList
);
StoreCatalogInheritance
(
relationId
,
inheritList
);
}
}
...
...
src/backend/commands/recipe.c
View file @
c445ba33
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.1
3 1997/11/25 21:59:00
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.1
4 1997/11/28 04:39:53
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1047,7 +1047,8 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
...
@@ -1047,7 +1047,8 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
len
=
length
(
q
->
qtrees
[
0
]
->
targetList
);
len
=
length
(
q
->
qtrees
[
0
]
->
targetList
);
tupdesc
=
rel
->
rd_att
;
tupdesc
=
rel
->
rd_att
;
relid
=
heap_create
(
child
->
nodeElem
->
outTypes
->
val
[
0
],
tupdesc
);
relid
=
heap_create_and_catalog
(
child
->
nodeElem
->
outTypes
->
val
[
0
],
tupdesc
);
}
}
else
else
{
{
...
@@ -1071,8 +1072,8 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
...
@@ -1071,8 +1072,8 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
}
}
else
else
{
{
relid
=
heap_create
(
child
->
nodeElem
->
outTypes
->
val
[
0
],
relid
=
heap_create
_and_catalog
(
tupdesc
);
child
->
nodeElem
->
outTypes
->
val
[
0
],
tupdesc
);
}
}
}
}
}
}
...
...
src/backend/executor/execAmi.c
View file @
c445ba33
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.1
1 1997/11/27 02:23:01
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.1
2 1997/11/28 04:40:03
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -443,10 +443,10 @@ ExecCreatR(TupleDesc tupType,
...
@@ -443,10 +443,10 @@ ExecCreatR(TupleDesc tupType,
*/
*/
/*
/*
* heap_creat
r creates a name if the argument to heap_creatr
is
* heap_creat
e creates a name if the argument to heap_create
is
* '\0 '
* '\0 '
*/
*/
relDesc
=
heap_creat
r
(
""
,
tupType
);
relDesc
=
heap_creat
e
(
""
,
tupType
);
}
}
else
else
{
{
...
...
src/backend/executor/execMain.c
View file @
c445ba33
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.3
3 1997/11/24 05:08:20
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.3
4 1997/11/28 04:40:08
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -572,7 +572,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
...
@@ -572,7 +572,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
/* fixup to prevent zero-length columns in create */
/* fixup to prevent zero-length columns in create */
setVarAttrLenForCreateTable
(
tupdesc
,
targetList
,
rangeTable
);
setVarAttrLenForCreateTable
(
tupdesc
,
targetList
,
rangeTable
);
intoRelationId
=
heap_create
(
intoName
,
tupdesc
);
intoRelationId
=
heap_create
_and_catalog
(
intoName
,
tupdesc
);
#ifdef NOT_USED
/* it's copy ... */
#ifdef NOT_USED
/* it's copy ... */
resetVarAttrLenForCreateTable
(
tupdesc
);
resetVarAttrLenForCreateTable
(
tupdesc
);
#endif
#endif
...
...
src/backend/executor/nodeTee.c
View file @
c445ba33
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* ExecEndTee
* ExecEndTee
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.1
1 1997/11/21 18:10:08
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.1
2 1997/11/28 04:40:12
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -167,8 +167,8 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
...
@@ -167,8 +167,8 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
if
(
RelationIsValid
(
r
))
if
(
RelationIsValid
(
r
))
bufferRel
=
heap_openr
(
teeState
->
tee_bufferRelname
);
bufferRel
=
heap_openr
(
teeState
->
tee_bufferRelname
);
else
else
bufferRel
=
heap_open
(
heap_create
(
teeState
->
tee_bufferRelname
,
bufferRel
=
heap_open
(
tupType
));
heap_create_and_catalog
(
teeState
->
tee_bufferRelname
,
tupType
));
}
}
else
else
{
{
...
@@ -176,8 +176,8 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
...
@@ -176,8 +176,8 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
"ttemp_%d"
,
/* 'ttemp' for 'tee' temporary */
"ttemp_%d"
,
/* 'ttemp' for 'tee' temporary */
newoid
());
newoid
());
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
bufferRel
=
heap_open
(
heap_create
(
teeState
->
tee_bufferRelname
,
bufferRel
=
heap_open
(
tupType
));
heap_create_and_catalog
(
teeState
->
tee_bufferRelname
,
tupType
));
}
}
teeState
->
tee_bufferRel
=
bufferRel
;
teeState
->
tee_bufferRel
=
bufferRel
;
...
...
src/backend/storage/large_object/inv_api.c
View file @
c445ba33
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.2
2 1997/11/21 19:02:37
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.2
3 1997/11/28 04:40:28
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -139,7 +139,7 @@ inv_create(int flags)
...
@@ -139,7 +139,7 @@ inv_create(int flags)
* be located on whatever storage manager the user requested.
* be located on whatever storage manager the user requested.
*/
*/
heap_create
(
objname
,
tupdesc
);
heap_create
_and_catalog
(
objname
,
tupdesc
);
/* make the relation visible in this transaction */
/* make the relation visible in this transaction */
CommandCounterIncrement
();
CommandCounterIncrement
();
...
...
src/include/catalog/heap.h
View file @
c445ba33
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: heap.h,v 1.
8 1997/11/21 18:11:56
momjian Exp $
* $Id: heap.h,v 1.
9 1997/11/28 04:40:40
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
#include <utils/rel.h>
#include <utils/rel.h>
extern
Relation
heap_creat
r
(
char
*
relname
,
TupleDesc
att
);
extern
Relation
heap_creat
e
(
char
*
relname
,
TupleDesc
att
);
extern
Oid
extern
Oid
heap_create
(
char
relname
[],
TupleDesc
tupdesc
);
heap_create
_and_catalog
(
char
relname
[],
TupleDesc
tupdesc
);
extern
void
heap_destroy
(
char
relname
[]);
extern
void
heap_destroy
(
char
relname
[]);
extern
void
heap_destroyr
(
Relation
r
);
extern
void
heap_destroyr
(
Relation
r
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment