Remove pg_collation.collversion.
authorThomas Munro <[email protected]>
Mon, 2 Nov 2020 06:36:09 +0000 (19:36 +1300)
committerThomas Munro <[email protected]>
Mon, 2 Nov 2020 11:44:59 +0000 (00:44 +1300)
This model couldn't be extended to cover the default collation, and
didn't have any information about the affected database objects when the
version changed.  Remove, in preparation for a follow-up commit that
will add a new mechanism.

Author: Thomas Munro <[email protected]>
Reviewed-by: Julien Rouhaud <[email protected]>
Reviewed-by: Peter Eisentraut <[email protected]>
Discussion: https://postgr.es/m/CAEepm%3D0uEQCpfq_%2BLYFBdArCe4Ot98t1aR4eYiYTe%3DyavQygiQ%40mail.gmail.com

22 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/func.sgml
doc/src/sgml/ref/alter_collation.sgml
doc/src/sgml/ref/create_collation.sgml
src/backend/catalog/pg_collation.c
src/backend/commands/collationcmds.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/gram.y
src/backend/tcop/utility.c
src/backend/utils/adt/pg_locale.c
src/bin/pg_dump/pg_dump.c
src/include/catalog/catversion.h
src/include/catalog/pg_collation.dat
src/include/catalog/pg_collation.h
src/include/catalog/toasting.h
src/include/commands/collationcmds.h
src/include/nodes/parsenodes.h
src/test/regress/expected/collate.icu.utf8.out
src/test/regress/expected/collate.linux.utf8.out
src/test/regress/sql/collate.icu.utf8.sql
src/test/regress/sql/collate.linux.utf8.sql

index 0ccdff1cda62f736b2147617faa53ae06f2d987b..d0d2598290e1f506f5c883533fe12c05cd5939e0 100644 (file)
@@ -2361,17 +2361,6 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <symbol>LC_CTYPE</symbol> for this collation object
       </para></entry>
      </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>collversion</structfield> <type>text</type>
-      </para>
-      <para>
-       Provider-specific version of the collation.  This is recorded when the
-       collation is created and then checked when it is used, to detect
-       changes in the collation definition that could lead to data corruption.
-      </para></entry>
-     </row>
     </tbody>
    </tgroup>
   </table>
index d8eee3a8264320c2ae9660e4d0235a41f279f719..0398b4909bf8d9dc0bbb2fcbb8cac3bd981c6133 100644 (file)
@@ -25444,11 +25444,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
        </para>
        <para>
         Returns the actual version of the collation object as it is currently
-        installed in the operating system.  If this is different from the
-        value in
-        <structname>pg_collation</structname>.<structfield>collversion</structfield>,
-        then objects depending on the collation might need to be rebuilt.  See
-        also <xref linkend="sql-altercollation"/>.
+        installed in the operating system.
        </para></entry>
       </row>
 
index af9ff2867b72234f94e2bf52b0def1086acb6c48..65429aabe28b3e8037612281719741a636062a21 100644 (file)
@@ -21,8 +21,6 @@ PostgreSQL documentation
 
  <refsynopsisdiv>
 <synopsis>
-ALTER COLLATION <replaceable>name</replaceable> REFRESH VERSION
-
 ALTER COLLATION <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
 ALTER COLLATION <replaceable>name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
 ALTER COLLATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
@@ -88,70 +86,9 @@ ALTER COLLATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_sche
     </listitem>
    </varlistentry>
 
-   <varlistentry>
-    <term><literal>REFRESH VERSION</literal></term>
-    <listitem>
-     <para>
-      Update the collation's version.
-      See <xref linkend="sql-altercollation-notes"/> below.
-     </para>
-    </listitem>
-   </varlistentry>
   </variablelist>
  </refsect1>
 
- <refsect1 id="sql-altercollation-notes" xreflabel="Notes">
-  <title>Notes</title>
-
-  <para>
-   When using collations provided by the ICU library, the ICU-specific version
-   of the collator is recorded in the system catalog when the collation object
-   is created.  When the collation is used, the current version is
-   checked against the recorded version, and a warning is issued when there is
-   a mismatch, for example:
-<screen>
-WARNING:  collation "xx-x-icu" has version mismatch
-DETAIL:  The collation in the database was created using version 1.2.3.4, but the operating system provides version 2.3.4.5.
-HINT:  Rebuild all objects affected by this collation and run ALTER COLLATION pg_catalog."xx-x-icu" REFRESH VERSION, or build PostgreSQL with the right library version.
-</screen>
-   A change in collation definitions can lead to corrupt indexes and other
-   problems because the database system relies on stored objects having a
-   certain sort order.  Generally, this should be avoided, but it can happen
-   in legitimate circumstances, such as when
-   using <command>pg_upgrade</command> to upgrade to server binaries linked
-   with a newer version of ICU.  When this happens, all objects depending on
-   the collation should be rebuilt, for example,
-   using <command>REINDEX</command>.  When that is done, the collation version
-   can be refreshed using the command <literal>ALTER COLLATION ... REFRESH
-   VERSION</literal>.  This will update the system catalog to record the
-   current collator version and will make the warning go away.  Note that this
-   does not actually check whether all affected objects have been rebuilt
-   correctly.
-  </para>
-  <para>
-   When using collations provided by <literal>libc</literal> and
-   <productname>PostgreSQL</productname> was built with the GNU C library, the
-   C library's version is used as a collation version.  Since collation
-   definitions typically change only with GNU C library releases, this provides
-   some defense against corruption, but it is not completely reliable.
-  </para>
-  <para>
-   Currently, there is no version tracking for the database default collation.
-  </para>
-
-  <para>
-   The following query can be used to identify all collations in the current
-   database that need to be refreshed and the objects that depend on them:
-<programlisting><![CDATA[
-SELECT pg_describe_object(refclassid, refobjid, refobjsubid) AS "Collation",
-       pg_describe_object(classid, objid, objsubid) AS "Object"
-  FROM pg_depend d JOIN pg_collation c
-       ON refclassid = 'pg_collation'::regclass AND refobjid = c.oid
-  WHERE c.collversion <> pg_collation_actual_version(c.oid)
-  ORDER BY 1, 2;
-]]></programlisting></para>
- </refsect1>
-
  <refsect1>
   <title>Examples</title>
 
index 58f5f0cd63a270df12ead21bc79cb5283b67415a..b97842071f92fe50cd2c0e4e06170ad4b92ede45 100644 (file)
@@ -27,7 +27,6 @@ CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> (
     [ LC_CTYPE = <replaceable>lc_ctype</replaceable>, ]
     [ PROVIDER = <replaceable>provider</replaceable>, ]
     [ DETERMINISTIC = <replaceable>boolean</replaceable>, ]
-    [ VERSION = <replaceable>version</replaceable> ]
 )
 CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> FROM <replaceable>existing_collation</replaceable>
 </synopsis>
@@ -149,26 +148,6 @@ CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> FROM <replace
      </listitem>
     </varlistentry>
 
-    <varlistentry>
-     <term><replaceable>version</replaceable></term>
-
-     <listitem>
-      <para>
-       Specifies the version string to store with the collation.  Normally,
-       this should be omitted, which will cause the version to be computed
-       from the actual version of the collation as provided by the operating
-       system.  This option is intended to be used
-       by <command>pg_upgrade</command> for copying the version from an
-       existing installation.
-      </para>
-
-      <para>
-       See also <xref linkend="sql-altercollation"/> for how to handle
-       collation version mismatches.
-      </para>
-     </listitem>
-    </varlistentry>
-
     <varlistentry>
      <term><replaceable>existing_collation</replaceable></term>
 
index 5fdf1acb7e5b37900bcc12d3b3366970282f005b..3c84378d0255d3a61989fd5103b69b157c9a7107 100644 (file)
@@ -49,7 +49,6 @@ CollationCreate(const char *collname, Oid collnamespace,
                bool collisdeterministic,
                int32 collencoding,
                const char *collcollate, const char *collctype,
-               const char *collversion,
                bool if_not_exists,
                bool quiet)
 {
@@ -167,10 +166,6 @@ CollationCreate(const char *collname, Oid collnamespace,
    values[Anum_pg_collation_collcollate - 1] = NameGetDatum(&name_collate);
    namestrcpy(&name_ctype, collctype);
    values[Anum_pg_collation_collctype - 1] = NameGetDatum(&name_ctype);
-   if (collversion)
-       values[Anum_pg_collation_collversion - 1] = CStringGetTextDatum(collversion);
-   else
-       nulls[Anum_pg_collation_collversion - 1] = true;
 
    tup = heap_form_tuple(tupDesc, values, nulls);
 
index 9f6582c530cbcf2c06e9c8008989437c98eb031f..5ad8886e60a44d78b1fbb2f22495f6aa9720ca37 100644 (file)
@@ -61,14 +61,12 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
    DefElem    *lcctypeEl = NULL;
    DefElem    *providerEl = NULL;
    DefElem    *deterministicEl = NULL;
-   DefElem    *versionEl = NULL;
    char       *collcollate = NULL;
    char       *collctype = NULL;
    char       *collproviderstr = NULL;
    bool        collisdeterministic = true;
    int         collencoding = 0;
    char        collprovider = 0;
-   char       *collversion = NULL;
    Oid         newoid;
    ObjectAddress address;
 
@@ -96,8 +94,6 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
            defelp = &providerEl;
        else if (strcmp(defel->defname, "deterministic") == 0)
            defelp = &deterministicEl;
-       else if (strcmp(defel->defname, "version") == 0)
-           defelp = &versionEl;
        else
        {
            ereport(ERROR,
@@ -166,9 +162,6 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
    if (deterministicEl)
        collisdeterministic = defGetBoolean(deterministicEl);
 
-   if (versionEl)
-       collversion = defGetString(versionEl);
-
    if (collproviderstr)
    {
        if (pg_strcasecmp(collproviderstr, "icu") == 0)
@@ -215,9 +208,6 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
        }
    }
 
-   if (!collversion)
-       collversion = get_collation_actual_version(collprovider, collcollate);
-
    newoid = CollationCreate(collName,
                             collNamespace,
                             GetUserId(),
@@ -226,7 +216,6 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
                             collencoding,
                             collcollate,
                             collctype,
-                            collversion,
                             if_not_exists,
                             false);    /* not quiet */
 
@@ -277,80 +266,6 @@ IsThereCollationInNamespace(const char *collname, Oid nspOid)
                        collname, get_namespace_name(nspOid))));
 }
 
-/*
- * ALTER COLLATION
- */
-ObjectAddress
-AlterCollation(AlterCollationStmt *stmt)
-{
-   Relation    rel;
-   Oid         collOid;
-   HeapTuple   tup;
-   Form_pg_collation collForm;
-   Datum       collversion;
-   bool        isnull;
-   char       *oldversion;
-   char       *newversion;
-   ObjectAddress address;
-
-   rel = table_open(CollationRelationId, RowExclusiveLock);
-   collOid = get_collation_oid(stmt->collname, false);
-
-   if (!pg_collation_ownercheck(collOid, GetUserId()))
-       aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_COLLATION,
-                      NameListToString(stmt->collname));
-
-   tup = SearchSysCacheCopy1(COLLOID, ObjectIdGetDatum(collOid));
-   if (!HeapTupleIsValid(tup))
-       elog(ERROR, "cache lookup failed for collation %u", collOid);
-
-   collForm = (Form_pg_collation) GETSTRUCT(tup);
-   collversion = SysCacheGetAttr(COLLOID, tup, Anum_pg_collation_collversion,
-                                 &isnull);
-   oldversion = isnull ? NULL : TextDatumGetCString(collversion);
-
-   newversion = get_collation_actual_version(collForm->collprovider, NameStr(collForm->collcollate));
-
-   /* cannot change from NULL to non-NULL or vice versa */
-   if ((!oldversion && newversion) || (oldversion && !newversion))
-       elog(ERROR, "invalid collation version change");
-   else if (oldversion && newversion && strcmp(newversion, oldversion) != 0)
-   {
-       bool        nulls[Natts_pg_collation];
-       bool        replaces[Natts_pg_collation];
-       Datum       values[Natts_pg_collation];
-
-       ereport(NOTICE,
-               (errmsg("changing version from %s to %s",
-                       oldversion, newversion)));
-
-       memset(values, 0, sizeof(values));
-       memset(nulls, false, sizeof(nulls));
-       memset(replaces, false, sizeof(replaces));
-
-       values[Anum_pg_collation_collversion - 1] = CStringGetTextDatum(newversion);
-       replaces[Anum_pg_collation_collversion - 1] = true;
-
-       tup = heap_modify_tuple(tup, RelationGetDescr(rel),
-                               values, nulls, replaces);
-   }
-   else
-       ereport(NOTICE,
-               (errmsg("version has not changed")));
-
-   CatalogTupleUpdate(rel, &tup->t_self, tup);
-
-   InvokeObjectPostAlterHook(CollationRelationId, collOid, 0);
-
-   ObjectAddressSet(address, CollationRelationId, collOid);
-
-   heap_freetuple(tup);
-   table_close(rel, NoLock);
-
-   return address;
-}
-
-
 Datum
 pg_collation_actual_version(PG_FUNCTION_ARGS)
 {
@@ -608,7 +523,6 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
            collid = CollationCreate(localebuf, nspid, GetUserId(),
                                     COLLPROVIDER_LIBC, true, enc,
                                     localebuf, localebuf,
-                                    get_collation_actual_version(COLLPROVIDER_LIBC, localebuf),
                                     true, true);
            if (OidIsValid(collid))
            {
@@ -669,7 +583,6 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
            collid = CollationCreate(alias, nspid, GetUserId(),
                                     COLLPROVIDER_LIBC, true, enc,
                                     locale, locale,
-                                    get_collation_actual_version(COLLPROVIDER_LIBC, locale),
                                     true, true);
            if (OidIsValid(collid))
            {
@@ -731,7 +644,6 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
                                     nspid, GetUserId(),
                                     COLLPROVIDER_ICU, true, -1,
                                     collcollate, collcollate,
-                                    get_collation_actual_version(COLLPROVIDER_ICU, collcollate),
                                     true, true);
            if (OidIsValid(collid))
            {
index 2b4d7654cc7154d1e166f5744aa7505410979868..ac8b57109c5652c349e775bfbca24f0b752563a7 100644 (file)
@@ -3224,16 +3224,6 @@ _copyAlterTableCmd(const AlterTableCmd *from)
    return newnode;
 }
 
-static AlterCollationStmt *
-_copyAlterCollationStmt(const AlterCollationStmt *from)
-{
-   AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
-
-   COPY_NODE_FIELD(collname);
-
-   return newnode;
-}
-
 static AlterDomainStmt *
 _copyAlterDomainStmt(const AlterDomainStmt *from)
 {
@@ -5229,9 +5219,6 @@ copyObjectImpl(const void *from)
        case T_AlterTableCmd:
            retval = _copyAlterTableCmd(from);
            break;
-       case T_AlterCollationStmt:
-           retval = _copyAlterCollationStmt(from);
-           break;
        case T_AlterDomainStmt:
            retval = _copyAlterDomainStmt(from);
            break;
index e2d1b987bf490b5399bc043a4f52feb65e511a89..0cf90ef33c31b7df716807ca24a4164cbb53a2ea 100644 (file)
@@ -1107,14 +1107,6 @@ _equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
    return true;
 }
 
-static bool
-_equalAlterCollationStmt(const AlterCollationStmt *a, const AlterCollationStmt *b)
-{
-   COMPARE_NODE_FIELD(collname);
-
-   return true;
-}
-
 static bool
 _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
 {
@@ -3283,9 +3275,6 @@ equal(const void *a, const void *b)
        case T_AlterTableCmd:
            retval = _equalAlterTableCmd(a, b);
            break;
-       case T_AlterCollationStmt:
-           retval = _equalAlterCollationStmt(a, b);
-           break;
        case T_AlterDomainStmt:
            retval = _equalAlterDomainStmt(a, b);
            break;
index 480d16834687a0486996317d4e3d79fc89c17165..60cf7242a30845e1c674a3fb141557bcd4737570 100644 (file)
@@ -254,7 +254,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
 }
 
 %type <node>   stmt schema_stmt
-       AlterEventTrigStmt AlterCollationStmt
+       AlterEventTrigStmt
        AlterDatabaseStmt AlterDatabaseSetStmt AlterDomainStmt AlterEnumStmt
        AlterFdwStmt AlterForeignServerStmt AlterGroupStmt
        AlterObjectDependsStmt AlterObjectSchemaStmt AlterOwnerStmt
@@ -835,7 +835,6 @@ stmtmulti:  stmtmulti ';' stmt
 
 stmt :
            AlterEventTrigStmt
-           | AlterCollationStmt
            | AlterDatabaseStmt
            | AlterDatabaseSetStmt
            | AlterDefaultPrivilegesStmt
@@ -10169,21 +10168,6 @@ drop_option:
                }
        ;
 
-/*****************************************************************************
- *
- *     ALTER COLLATION
- *
- *****************************************************************************/
-
-AlterCollationStmt: ALTER COLLATION any_name REFRESH VERSION_P
-               {
-                   AlterCollationStmt *n = makeNode(AlterCollationStmt);
-                   n->collname = $3;
-                   $$ = (Node *)n;
-               }
-       ;
-
-
 /*****************************************************************************
  *
  *     ALTER SYSTEM
index 9a35147b26af357f7caff456d31f03c82e3c0e07..f398027fa6190f16a832a1a3eb8f0e3f25255b52 100644 (file)
@@ -1842,10 +1842,6 @@ ProcessUtilitySlow(ParseState *pstate,
                address = AlterStatistics((AlterStatsStmt *) parsetree);
                break;
 
-           case T_AlterCollationStmt:
-               address = AlterCollation((AlterCollationStmt *) parsetree);
-               break;
-
            default:
                elog(ERROR, "unrecognized node type: %d",
                     (int) nodeTag(parsetree));
@@ -2993,10 +2989,6 @@ CreateCommandTag(Node *parsetree)
            tag = CMDTAG_DROP_SUBSCRIPTION;
            break;
 
-       case T_AlterCollationStmt:
-           tag = CMDTAG_ALTER_COLLATION;
-           break;
-
        case T_PrepareStmt:
            tag = CMDTAG_PREPARE;
            break;
@@ -3609,10 +3601,6 @@ GetCommandLogLevel(Node *parsetree)
            lev = LOGSTMT_DDL;
            break;
 
-       case T_AlterCollationStmt:
-           lev = LOGSTMT_DDL;
-           break;
-
            /* already-planned queries */
        case T_PlannedStmt:
            {
index 07299dbc09111b899f5d99adf042347334dd606b..514e0fa0af866e5b0d5b3a11d826c2f0315ab6c9 100644 (file)
@@ -1513,8 +1513,6 @@ pg_newlocale_from_collation(Oid collid)
        const char *collctype pg_attribute_unused();
        struct pg_locale_struct result;
        pg_locale_t resultp;
-       Datum       collversion;
-       bool        isnull;
 
        tp = SearchSysCache1(COLLOID, ObjectIdGetDatum(collid));
        if (!HeapTupleIsValid(tp))
@@ -1616,41 +1614,6 @@ pg_newlocale_from_collation(Oid collid)
 #endif                         /* not USE_ICU */
        }
 
-       collversion = SysCacheGetAttr(COLLOID, tp, Anum_pg_collation_collversion,
-                                     &isnull);
-       if (!isnull)
-       {
-           char       *actual_versionstr;
-           char       *collversionstr;
-
-           actual_versionstr = get_collation_actual_version(collform->collprovider, collcollate);
-           if (!actual_versionstr)
-           {
-               /*
-                * This could happen when specifying a version in CREATE
-                * COLLATION for a libc locale, or manually creating a mess in
-                * the catalogs.
-                */
-               ereport(ERROR,
-                       (errmsg("collation \"%s\" has no actual version, but a version was specified",
-                               NameStr(collform->collname))));
-           }
-           collversionstr = TextDatumGetCString(collversion);
-
-           if (strcmp(actual_versionstr, collversionstr) != 0)
-               ereport(WARNING,
-                       (errmsg("collation \"%s\" has version mismatch",
-                               NameStr(collform->collname)),
-                        errdetail("The collation in the database was created using version %s, "
-                                  "but the operating system provides version %s.",
-                                  collversionstr, actual_versionstr),
-                        errhint("Rebuild all objects affected by this collation and run "
-                                "ALTER COLLATION %s REFRESH VERSION, "
-                                "or build PostgreSQL with the right library version.",
-                                quote_qualified_identifier(get_namespace_name(collform->collnamespace),
-                                                           NameStr(collform->collname)))));
-       }
-
        ReleaseSysCache(tp);
 
        /* We'll keep the pg_locale_t structures in TopMemoryContext */
index 03f9d4d9e84f723b91af1ba1e3b9ffe23756f244..9851022a53d426a6f266e01ad2d9a501f17700c6 100644 (file)
@@ -13589,12 +13589,10 @@ dumpCollation(Archive *fout, CollInfo *collinfo)
 
    if (fout->remoteVersion >= 100000)
        appendPQExpBufferStr(query,
-                            "collprovider, "
-                            "collversion, ");
+                            "collprovider, ");
    else
        appendPQExpBufferStr(query,
-                            "'c' AS collprovider, "
-                            "NULL AS collversion, ");
+                            "'c' AS collprovider, ");
 
    if (fout->remoteVersion >= 120000)
        appendPQExpBufferStr(query,
@@ -13655,24 +13653,6 @@ dumpCollation(Archive *fout, CollInfo *collinfo)
        appendStringLiteralAH(q, collctype, fout);
    }
 
-   /*
-    * For binary upgrade, carry over the collation version.  For normal
-    * dump/restore, omit the version, so that it is computed upon restore.
-    */
-   if (dopt->binary_upgrade)
-   {
-       int         i_collversion;
-
-       i_collversion = PQfnumber(res, "collversion");
-       if (!PQgetisnull(res, 0, i_collversion))
-       {
-           appendPQExpBufferStr(q, ", version = ");
-           appendStringLiteralAH(q,
-                                 PQgetvalue(res, 0, i_collversion),
-                                 fout);
-       }
-   }
-
    appendPQExpBufferStr(q, ");\n");
 
    if (dopt->binary_upgrade)
index 73650f88e94740ba06d13b6ee6b38e6566d7673a..fbb729a0b2ef8857af65724a570c128582f58634 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 202010291
+#define CATALOG_VERSION_NO 202011011
 
 #endif
index ba1b3e201b67cd4749665a9e3edfb6b917bf6875..45301ccdd7d183d3af44640a833d5ae35e17c838 100644 (file)
 { oid => '100', oid_symbol => 'DEFAULT_COLLATION_OID',
   descr => 'database\'s default collation',
   collname => 'default', collnamespace => 'PGNSP', collowner => 'PGUID',
-  collprovider => 'd', collencoding => '-1', collcollate => '', collctype => '',
-  collversion => '_null_' },
+  collprovider => 'd', collencoding => '-1', collcollate => '', collctype => '' },
 { oid => '950', oid_symbol => 'C_COLLATION_OID',
   descr => 'standard C collation',
   collname => 'C', collnamespace => 'PGNSP', collowner => 'PGUID',
   collprovider => 'c', collencoding => '-1', collcollate => 'C',
-  collctype => 'C', collversion => '_null_' },
+  collctype => 'C' },
 { oid => '951', oid_symbol => 'POSIX_COLLATION_OID',
   descr => 'standard POSIX collation',
   collname => 'POSIX', collnamespace => 'PGNSP', collowner => 'PGUID',
   collprovider => 'c', collencoding => '-1', collcollate => 'POSIX',
-  collctype => 'POSIX', collversion => '_null_' },
+  collctype => 'POSIX' },
 
 ]
index 27618b324d3f02721d24b89d94ff2027be9cc3df..e7e958b80898a85d11d4fec44cccac96b8088d1b 100644 (file)
@@ -37,10 +37,6 @@ CATALOG(pg_collation,3456,CollationRelationId)
    int32       collencoding;   /* encoding for this collation; -1 = "all" */
    NameData    collcollate;    /* LC_COLLATE setting */
    NameData    collctype;      /* LC_CTYPE setting */
-#ifdef CATALOG_VARLEN          /* variable-length fields start here */
-   text        collversion;    /* provider-dependent version of collation
-                                * data */
-#endif
 } FormData_pg_collation;
 
 /* ----------------
@@ -65,7 +61,6 @@ extern Oid    CollationCreate(const char *collname, Oid collnamespace,
                            bool collisdeterministic,
                            int32 collencoding,
                            const char *collcollate, const char *collctype,
-                           const char *collversion,
                            bool if_not_exists,
                            bool quiet);
 
index 51491c451314c8492e00d60894ca6b1603f567b9..8f131893dc4b1ff539cc5396675939f28911bd18 100644 (file)
@@ -51,7 +51,6 @@ extern void BootstrapToastTable(char *relName,
 /* normal catalogs */
 DECLARE_TOAST(pg_aggregate, 4159, 4160);
 DECLARE_TOAST(pg_attrdef, 2830, 2831);
-DECLARE_TOAST(pg_collation, 4161, 4162);
 DECLARE_TOAST(pg_constraint, 2832, 2833);
 DECLARE_TOAST(pg_default_acl, 4143, 4144);
 DECLARE_TOAST(pg_description, 2834, 2835);
index 373b85374c42d2743c64858c629a322ad6c41b83..3e1c16ac7f056d0f811e1c835a123db8e7989cc3 100644 (file)
@@ -20,6 +20,5 @@
 
 extern ObjectAddress DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_exists);
 extern void IsThereCollationInNamespace(const char *collname, Oid nspOid);
-extern ObjectAddress AlterCollation(AlterCollationStmt *stmt);
 
 #endif                         /* COLLATIONCMDS_H */
index ff584f2955bb1aa1bd9aba4762b625b69d6e445f..319f77013f4d3ac6e7d84435fcc7cf58fcd20f8e 100644 (file)
@@ -1879,17 +1879,6 @@ typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
 } AlterTableCmd;
 
 
-/* ----------------------
- * Alter Collation
- * ----------------------
- */
-typedef struct AlterCollationStmt
-{
-   NodeTag     type;
-   List       *collname;
-} AlterCollationStmt;
-
-
 /* ----------------------
  * Alter Domain
  *
index 2b86ce90286ddf6436c4c6fea48bcecf0ae798a6..60d9263a2ffce47d90e8d2f6a3fb686b4d889cc4 100644 (file)
@@ -1082,9 +1082,6 @@ SELECT collname FROM pg_collation WHERE collname LIKE 'test%';
 
 DROP SCHEMA test_schema;
 DROP ROLE regress_test_role;
--- ALTER
-ALTER COLLATION "en-x-icu" REFRESH VERSION;
-NOTICE:  version has not changed
 -- dependencies
 CREATE COLLATION test0 FROM "C";
 CREATE TABLE collate_dep_test1 (a int, b text COLLATE test0);
index f06ae543e497713787cccd057080c1ee5837cf30..580b00eea79bcf75829d932aaed8f45831752dd2 100644 (file)
@@ -1093,9 +1093,6 @@ SELECT collname FROM pg_collation WHERE collname LIKE 'test%';
 
 DROP SCHEMA test_schema;
 DROP ROLE regress_test_role;
--- ALTER
-ALTER COLLATION "en_US" REFRESH VERSION;
-NOTICE:  version has not changed
 -- dependencies
 CREATE COLLATION test0 FROM "C";
 CREATE TABLE collate_dep_test1 (a int, b text COLLATE test0);
index 67de7d97949f5ecd99acc197262ce9406e8d10ca..35acf91fbf1e49d6e636194959c65987c791f588 100644 (file)
@@ -405,11 +405,6 @@ DROP SCHEMA test_schema;
 DROP ROLE regress_test_role;
 
 
--- ALTER
-
-ALTER COLLATION "en-x-icu" REFRESH VERSION;
-
-
 -- dependencies
 
 CREATE COLLATION test0 FROM "C";
index cbbd2203e413b0141242224e444dd353a92a56fe..c697c994880555f216f5ace3ef8b82be71fb3c03 100644 (file)
@@ -406,11 +406,6 @@ DROP SCHEMA test_schema;
 DROP ROLE regress_test_role;
 
 
--- ALTER
-
-ALTER COLLATION "en_US" REFRESH VERSION;
-
-
 -- dependencies
 
 CREATE COLLATION test0 FROM "C";