File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -186,17 +186,19 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
186
186
<term><literal>FREEZE</literal></term>
187
187
<listitem>
188
188
<para>
189
- Specifies copying the data with rows already frozen, just as they
189
+ Requests copying the data with rows already frozen, just as they
190
190
would be after running the <command>VACUUM FREEZE</> command.
191
191
This is intended as a performance option for initial data loading.
192
192
Rows will be frozen only if the table being loaded has been created
193
193
in the current subtransaction, there are no cursors open and there
194
194
are no older snapshots held by this transaction. If those conditions
195
195
are not met the command will continue without error though will not
196
- freeze rows.
196
+ freeze rows. It is also possible in rare cases that the request
197
+ cannot be honoured for internal reasons, hence <literal>FREEZE</literal>
198
+ is more of a guideline than a hard rule.
197
199
</para>
198
200
<para>
199
- Note that all sessions will immediately be able to see the data
201
+ Note that all other sessions will immediately be able to see the data
200
202
once it has been successfully loaded. This violates the normal rules
201
203
of MVCC visibility and by specifying this option the user acknowledges
202
204
explicitly that this is understood.
Original file line number Diff line number Diff line change @@ -1993,6 +1993,11 @@ CopyFrom(CopyState cstate)
1993
1993
* after xact cleanup. Note that the stronger test of exactly
1994
1994
* which subtransaction created it is crucial for correctness
1995
1995
* of this optimisation.
1996
+ *
1997
+ * Note that because the test is unreliable in case of relcache reset
1998
+ * we cannot guarantee that we can honour the request to FREEZE.
1999
+ * If we cannot honour the request we do so silently, firstly to
2000
+ * avoid noise for the user and also to avoid obscure test failures.
1996
2001
*/
1997
2002
if (cstate -> freeze &&
1998
2003
ThereAreNoPriorRegisteredSnapshots () &&
@@ -2001,11 +2006,6 @@ CopyFrom(CopyState cstate)
2001
2006
hi_options |= HEAP_INSERT_FROZEN ;
2002
2007
}
2003
2008
2004
- if (cstate -> freeze && (hi_options & HEAP_INSERT_FROZEN ) == 0 )
2005
- ereport (NOTICE ,
2006
- (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
2007
- errmsg ("FREEZE option specified but pre-conditions not met" )));
2008
-
2009
2009
/*
2010
2010
* We need a ResultRelInfo so we can use the regular executor's
2011
2011
* index-entry-making machinery. (There used to be a huge amount of code
You can’t perform that action at this time.
0 commit comments