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
f41f8eeb
Commit
f41f8eeb
authored
Oct 11, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix temp relation handling for indexes, cleanup
parent
75e3ba33
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
32 deletions
+21
-32
src/backend/access/transam/xact.c
src/backend/access/transam/xact.c
+2
-2
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+4
-4
src/backend/catalog/index.c
src/backend/catalog/index.c
+3
-3
src/backend/utils/cache/temprel.c
src/backend/utils/cache/temprel.c
+9
-20
src/include/utils/temprel.h
src/include/utils/temprel.h
+3
-3
No files found.
src/backend/access/transam/xact.c
View file @
f41f8eeb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.7
1 2000/09/27 10:41:55 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.7
2 2000/10/11 21:28:17 momjian
Exp $
*
*
* NOTES
* NOTES
* Transaction aborts can now occur two ways:
* Transaction aborts can now occur two ways:
...
@@ -1119,7 +1119,7 @@ AbortTransaction()
...
@@ -1119,7 +1119,7 @@ AbortTransaction()
AtEOXact_portals
();
AtEOXact_portals
();
RecordTransactionAbort
();
RecordTransactionAbort
();
RelationPurgeLocalRelation
(
false
);
RelationPurgeLocalRelation
(
false
);
invalidate_temp_relations
();
remove_temp_rel_in_myxid
();
AtEOXact_SPI
();
AtEOXact_SPI
();
AtEOXact_nbtree
();
AtEOXact_nbtree
();
AtAbort_Cache
();
AtAbort_Cache
();
...
...
src/backend/catalog/heap.c
View file @
f41f8eeb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.14
7 2000/10/05 19:48:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.14
8 2000/10/11 21:28:18
momjian Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -1489,7 +1489,7 @@ heap_drop_with_catalog(const char *relname,
...
@@ -1489,7 +1489,7 @@ heap_drop_with_catalog(const char *relname,
RelationForgetRelation
(
rid
);
RelationForgetRelation
(
rid
);
if
(
istemp
)
if
(
istemp
)
remove_temp_rel
ation
(
rid
);
remove_temp_rel
_by_relid
(
rid
);
if
(
has_toasttable
)
if
(
has_toasttable
)
{
{
...
...
src/backend/catalog/index.c
View file @
f41f8eeb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.12
7 2000/10/05 19:48:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.12
8 2000/10/11 21:28:18
momjian Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -1145,7 +1145,7 @@ index_drop(Oid indexId)
...
@@ -1145,7 +1145,7 @@ index_drop(Oid indexId)
RelationForgetRelation
(
indexId
);
RelationForgetRelation
(
indexId
);
/* does something only if it is a temp index */
/* does something only if it is a temp index */
remove_temp_rel
ation
(
indexId
);
remove_temp_rel
_by_relid
(
indexId
);
}
}
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
...
...
src/backend/utils/cache/temprel.c
View file @
f41f8eeb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.2
7 2000/07/12 18:04:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.2
8 2000/10/11 21:28:19
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -91,35 +91,24 @@ create_temp_relation(const char *relname, HeapTuple pg_class_tuple)
...
@@ -91,35 +91,24 @@ create_temp_relation(const char *relname, HeapTuple pg_class_tuple)
void
void
remove_all_temp_relations
(
void
)
remove_all_temp_relations
(
void
)
{
{
List
*
l
,
*
next
;
if
(
temp_rels
==
NIL
)
return
;
AbortOutOfAnyTransaction
();
AbortOutOfAnyTransaction
();
StartTransactionCommand
();
StartTransactionCommand
();
l
=
temp_rels
;
while
(
temp_rels
!=
NIL
)
while
(
l
!=
NIL
)
{
{
TempTable
*
temp_rel
=
(
TempTable
*
)
lfirst
(
l
);
char
relname
[
NAMEDATALEN
];
TempTable
*
temp_rel
=
(
TempTable
*
)
lfirst
(
temp_rels
);
next
=
lnext
(
l
);
/* do this first, l is deallocated */
/* Indexes are dropped during heap drop */
if
(
temp_rel
->
relkind
!=
RELKIND_INDEX
)
if
(
temp_rel
->
relkind
!=
RELKIND_INDEX
)
{
{
char
relname
[
NAMEDATALEN
];
/* safe from deallocation */
/* safe from deallocation */
strcpy
(
relname
,
temp_rel
->
user_relname
);
strcpy
(
relname
,
temp_rel
->
user_relname
);
heap_drop_with_catalog
(
relname
,
allowSystemTableMods
);
heap_drop_with_catalog
(
relname
,
allowSystemTableMods
);
}
}
else
l
=
next
;
index_drop
(
temp_rel
->
relid
);
CommandCounterIncrement
();
}
}
temp_rels
=
NIL
;
CommitTransactionCommand
();
CommitTransactionCommand
();
}
}
...
@@ -129,7 +118,7 @@ remove_all_temp_relations(void)
...
@@ -129,7 +118,7 @@ remove_all_temp_relations(void)
* we don't have the relname for indexes, so we just pass the oid
* we don't have the relname for indexes, so we just pass the oid
*/
*/
void
void
remove_temp_rel
ation
(
Oid
relid
)
remove_temp_rel
_by_relid
(
Oid
relid
)
{
{
MemoryContext
oldcxt
;
MemoryContext
oldcxt
;
List
*
l
,
List
*
l
,
...
@@ -179,7 +168,7 @@ remove_temp_relation(Oid relid)
...
@@ -179,7 +168,7 @@ remove_temp_relation(Oid relid)
* We just have to delete the map entry.
* We just have to delete the map entry.
*/
*/
void
void
invalidate_temp_relations
(
void
)
remove_temp_rel_in_myxid
(
void
)
{
{
MemoryContext
oldcxt
;
MemoryContext
oldcxt
;
List
*
l
,
List
*
l
,
...
...
src/include/utils/temprel.h
View file @
f41f8eeb
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: temprel.h,v 1.1
0 2000/06/20 06:41:11 tgl
Exp $
* $Id: temprel.h,v 1.1
1 2000/10/11 21:28:19 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -18,12 +18,12 @@
...
@@ -18,12 +18,12 @@
extern
void
create_temp_relation
(
const
char
*
relname
,
extern
void
create_temp_relation
(
const
char
*
relname
,
HeapTuple
pg_class_tuple
);
HeapTuple
pg_class_tuple
);
extern
void
remove_temp_rel
ation
(
Oid
relid
);
extern
void
remove_temp_rel
_by_relid
(
Oid
relid
);
extern
bool
rename_temp_relation
(
const
char
*
oldname
,
extern
bool
rename_temp_relation
(
const
char
*
oldname
,
const
char
*
newname
);
const
char
*
newname
);
extern
void
remove_all_temp_relations
(
void
);
extern
void
remove_all_temp_relations
(
void
);
extern
void
invalidate_temp_relations
(
void
);
extern
void
remove_temp_rel_in_myxid
(
void
);
extern
char
*
get_temp_rel_by_username
(
const
char
*
user_relname
);
extern
char
*
get_temp_rel_by_username
(
const
char
*
user_relname
);
extern
char
*
get_temp_rel_by_physicalname
(
const
char
*
relname
);
extern
char
*
get_temp_rel_by_physicalname
(
const
char
*
relname
);
...
...
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