1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Fixes: Errors when PQexec() in backend creates temp

relations and transaction is aborted

Submitted by: wieck@sapserv.debis.de (Jan Wieck)
This commit is contained in:
Marc G. Fournier
1996-10-24 07:55:54 +00:00
parent e152661200
commit 20b4c46e26
4 changed files with 30 additions and 8 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.2 1996/10/23 07:41:00 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.3 1996/10/24 07:55:29 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -1418,7 +1418,14 @@ RelationPurgeLocalRelation(bool xactCommitted)
* remove the file if we abort. This is so that files for
* tables created inside a transaction block get removed.
*/
smgrunlink(reln->rd_rel->relsmgr, reln);
if(reln->rd_istemp) {
if(!(reln->rd_tmpunlinked)) {
smgrunlink(reln->rd_rel->relsmgr, reln);
reln->rd_tmpunlinked = TRUE;
}
} else {
smgrunlink(reln->rd_rel->relsmgr, reln);
}
}
reln->rd_islocal = FALSE;