diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-02-03 10:01:30 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-02-03 10:01:30 +0000 |
commit | 9de778b24b7d4040a385486348904db1bf69f677 (patch) | |
tree | 575b906bda0ed9b86a52480cefdff773eadb3a42 /src/backend/executor/execMain.c | |
parent | 808969d0e7ac2d2fdbd915c6a6ac9ec68b6f63f9 (diff) | |
download | postgresql-9de778b24b7d4040a385486348904db1bf69f677.tar.gz postgresql-9de778b24b7d4040a385486348904db1bf69f677.zip |
Move the responsibility of writing a "unlogged WAL operation" record from
heap_sync() to the callers, because heap_sync() is sometimes called even
if the operation itself is WAL-logged. This eliminates the bogus unlogged
records from CLUSTER that Simon Riggs reported, patch by Fujii Masao.
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r-- | src/backend/executor/execMain.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index b0698489c41..5a8af0b2f75 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -26,7 +26,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.343 2010/01/28 23:21:11 petere Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.344 2010/02/03 10:01:30 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -2240,7 +2240,13 @@ CloseIntoRel(QueryDesc *queryDesc) /* If we skipped using WAL, must heap_sync before commit */ if (myState->hi_options & HEAP_INSERT_SKIP_WAL) + { + char reason[NAMEDATALEN + 30]; + snprintf(reason, sizeof(reason), "SELECT INTO on \"%s\"", + RelationGetRelationName(myState->rel)); + XLogReportUnloggedStatement(reason); heap_sync(myState->rel); + } /* close rel, but keep lock until commit */ heap_close(myState->rel, NoLock); |