Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
d9a069e2
Commit
d9a069e2
authored
24 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Move temprel name define from temprel.h to rel.h.
parent
d47e10bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/include/utils/rel.h
+45
-38
45 additions, 38 deletions
src/include/utils/rel.h
src/include/utils/temprel.h
+1
-6
1 addition, 6 deletions
src/include/utils/temprel.h
with
46 additions
and
44 deletions
src/include/utils/rel.h
+
45
−
38
View file @
d9a069e2
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: rel.h,v 1.4
7
2001/06/19
05:11:50 tgl
Exp $
* $Id: rel.h,v 1.4
8
2001/06/19
12:03:41 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -187,43 +187,6 @@ typedef Relation *RelationPtr;
*/
#define RelationGetFile(relation) ((relation)->rd_fd)
/*
* RelationGetRelationName
*
* Returns the relation's logical name (as seen by the user).
*
* If the rel is a temp rel, the temp name will be returned. Therefore,
* this name is not unique. But it is the name to use in heap_openr(),
* for example.
*/
#define RelationGetRelationName(relation) \
(\
(strncmp(RelationGetPhysicalRelationName(relation), \
"pg_temp", 7) != 0) \
? \
RelationGetPhysicalRelationName(relation) \
: \
get_temp_rel_by_physicalname( \
RelationGetPhysicalRelationName(relation)) \
)
/*
* RelationGetPhysicalRelationName
*
* Returns the rel's physical name, ie, the name appearing in pg_class.
*
* While this name is unique across all rels in the database, it is not
* necessarily useful for accessing the rel, since a temp table of the
* same name might mask the rel. It is useful mainly for determining if
* the rel is a shared system rel or not.
*
* The macro is rather unfortunately named, since the pg_class name no longer
* has anything to do with the file name used for physical storage of the rel.
*/
#define RelationGetPhysicalRelationName(relation) \
(NameStr((relation)->rd_rel->relname))
/*
* RelationGetNumberOfAttributes
*
...
...
@@ -254,4 +217,48 @@ extern void RelationSetIndexSupport(Relation relation,
IndexStrategy
strategy
,
RegProcedure
*
support
);
/*
* Handle temp relations
*/
#define PG_TEMP_REL_PREFIX "pg_temp"
#define is_temp_relname(relname) \
(strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)) == 0)
/*
* RelationGetPhysicalRelationName
*
* Returns the rel's physical name, ie, the name appearing in pg_class.
*
* While this name is unique across all rels in the database, it is not
* necessarily useful for accessing the rel, since a temp table of the
* same name might mask the rel. It is useful mainly for determining if
* the rel is a shared system rel or not.
*
* The macro is rather unfortunately named, since the pg_class name no longer
* has anything to do with the file name used for physical storage of the rel.
*/
#define RelationGetPhysicalRelationName(relation) \
(NameStr((relation)->rd_rel->relname))
/*
* RelationGetRelationName
*
* Returns the relation's logical name (as seen by the user).
*
* If the rel is a temp rel, the temp name will be returned. Therefore,
* this name is not unique. But it is the name to use in heap_openr(),
* for example.
*/
#define RelationGetRelationName(relation) \
(\
!is_temp_relname(relation) \
? \
RelationGetPhysicalRelationName(relation) \
: \
get_temp_rel_by_physicalname( \
RelationGetPhysicalRelationName(relation)) \
)
#endif
/* REL_H */
This diff is collapsed.
Click to expand it.
src/include/utils/temprel.h
+
1
−
6
View file @
d9a069e2
...
...
@@ -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
6
2001/06/1
8
1
6:1
3:
2
1 momjian Exp $
* $Id: temprel.h,v 1.1
7
2001/06/1
9
1
2:0
3:
4
1 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -16,11 +16,6 @@
#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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment