Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6da0055

Browse files
committed
Fix for SELECT INTO ... GROUP/ORDER BY where table already exists unlink error.
1 parent8fb0ac8 commit6da0055

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.8 1996/11/05 09:53:01 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.9 1997/01/01 06:01:03 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -495,6 +495,10 @@ heap_open(Oid relationId)
495495
IncrHeapAccessStat(global_open);
496496

497497
r= (Relation)RelationIdGetRelation(relationId);
498+
499+
if(RelationIsValid(r)&&r->rd_istemp) {
500+
r->rd_tmpunlinked= FALSE;/* now we can unlink it */
501+
}
498502

499503
if (RelationIsValid(r)&&r->rd_rel->relkind==RELKIND_INDEX) {
500504
elog(WARN,"%s is an index relation",r->rd_rel->relname.data);
@@ -524,6 +528,10 @@ heap_openr(char *relationName)
524528

525529
r=RelationNameGetRelation(relationName);
526530

531+
if(RelationIsValid(r)&&r->rd_istemp) {
532+
r->rd_tmpunlinked= FALSE;/* now we can unlink it */
533+
}
534+
527535
if (RelationIsValid(r)&&r->rd_rel->relkind==RELKIND_INDEX) {
528536
elog(WARN,"%s is an index relation",r->rd_rel->relname.data);
529537
}

‎src/backend/catalog/heap.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.9 1996/12/31 06:58:27 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.10 1997/01/01 06:01:16 momjian Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
*heap_creatr()- Create an uncataloged heap relation
@@ -303,7 +303,8 @@ heap_creatr(char *name,
303303
*/
304304

305305
rdesc->rd_istemp=isTemp;
306-
306+
rdesc->rd_tmpunlinked= TRUE;/* change once table is opened */
307+
307308
/* ----------------
308309
*have the storage manager create the relation.
309310
* ----------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp