1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Clarify that COPY FREEZE is not a hard rule.

Remove message when FREEZE not honoured,
clarify reasons in comments and docs.
This commit is contained in:
Simon Riggs
2012-12-07 12:59:05 +00:00
parent 31a891857a
commit 1eb6cee499
2 changed files with 10 additions and 8 deletions

View File

@ -1993,6 +1993,11 @@ CopyFrom(CopyState cstate)
* after xact cleanup. Note that the stronger test of exactly
* which subtransaction created it is crucial for correctness
* of this optimisation.
*
* Note that because the test is unreliable in case of relcache reset
* we cannot guarantee that we can honour the request to FREEZE.
* If we cannot honour the request we do so silently, firstly to
* avoid noise for the user and also to avoid obscure test failures.
*/
if (cstate->freeze &&
ThereAreNoPriorRegisteredSnapshots() &&
@ -2001,11 +2006,6 @@ CopyFrom(CopyState cstate)
hi_options |= HEAP_INSERT_FROZEN;
}
if (cstate->freeze && (hi_options & HEAP_INSERT_FROZEN) == 0)
ereport(NOTICE,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("FREEZE option specified but pre-conditions not met")));
/*
* We need a ResultRelInfo so we can use the regular executor's
* index-entry-making machinery. (There used to be a huge amount of code