diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 8aae711b3b..0d93245e1a 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -223,6 +223,7 @@ COPY { table_name [ ( COPY FREEZE on
a partitioned table.
+ This option is allowed only in COPY FROM.
Note that all other sessions will immediately be able to see the data
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 3ac731803b..10111d7166 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -695,6 +695,12 @@ ProcessCopyOptions(ParseState *pstate,
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("CSV quote character must not appear in the NULL specification")));
+
+ /* Check freeze */
+ if (opts_out->freeze && !is_from)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("COPY freeze only available using COPY FROM")));
}
/*