We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent78a030a commit17082a8Copy full SHA for 17082a8
src/backend/commands/collationcmds.c
@@ -120,6 +120,18 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
120
collprovider= ((Form_pg_collation)GETSTRUCT(tp))->collprovider;
121
122
ReleaseSysCache(tp);
123
+
124
+/*
125
+ * Copying the "default" collation is not allowed because most code
126
+ * checks for DEFAULT_COLLATION_OID instead of COLLPROVIDER_DEFAULT,
127
+ * and so having a second collation with COLLPROVIDER_DEFAULT would
128
+ * not work and potentially confuse or crash some code. This could be
129
+ * fixed with some legwork.
130
+ */
131
+if (collprovider==COLLPROVIDER_DEFAULT)
132
+ereport(ERROR,
133
+(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
134
+errmsg("collation \"default\" cannot be copied")));
135
}
136
137
if (localeEl)