aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2021-05-07 20:17:42 +1200
committerThomas Munro <tmunro@postgresql.org>2021-05-07 21:10:11 +1200
commitec48314708262d8ea6cdcb83f803fc83dd89e721 (patch)
treef5b7c82ea571ce78aaa355095dd588dce07349ff /src/backend/commands/tablecmds.c
parenta288d94c91e345ebeb10ac30f247270c8c8e380a (diff)
downloadpostgresql-ec48314708262d8ea6cdcb83f803fc83dd89e721.tar.gz
postgresql-ec48314708262d8ea6cdcb83f803fc83dd89e721.zip
Revert per-index collation version tracking feature.
Design problems were discovered in the handling of composite types and record types that would cause some relevant versions not to be recorded. Misgivings were also expressed about the use of the pg_depend catalog for this purpose. We're out of time for this release so we'll revert and try again. Commits reverted: 1bf946bd: Doc: Document known problem with Windows collation versions. cf002008: Remove no-longer-relevant test case. ef387bed: Fix bogus collation-version-recording logic. 0fb0a050: Hide internal error for pg_collation_actual_version(<bad OID>). ff942057: Suppress "warning: variable 'collcollate' set but not used". d50e3b1f: Fix assertion in collation version lookup. f24b1569: Rethink extraction of collation dependencies. 257836a7: Track collation versions for indexes. cd6f479e: Add pg_depend.refobjversion. 7d1297df: Remove pg_collation.collversion. Discussion: https://postgr.es/m/CA%2BhUKGLhj5t1fcjqAu8iD9B3ixJtsTNqyCCD4V0aTO9kAKAjjA%40mail.gmail.com
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 0da61784d7a..3b5d4116839 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -94,7 +94,6 @@
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/partcache.h"
-#include "utils/pg_locale.h"
#include "utils/relcache.h"
#include "utils/ruleutils.h"
#include "utils/snapmgr.h"
@@ -602,7 +601,6 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,
Relation partitionTbl);
static List *GetParentedForeignKeyRefs(Relation partition);
static void ATDetachCheckNoForeignKeyRefs(Relation partition);
-static void ATExecAlterCollationRefreshVersion(Relation rel, List *coll);
static char GetAttributeCompression(Form_pg_attribute att, char *compression);
@@ -4333,10 +4331,6 @@ AlterTableGetLockLevel(List *cmds)
cmd_lockmode = AccessShareLock;
break;
- case AT_AlterCollationRefreshVersion:
- cmd_lockmode = AccessExclusiveLock;
- break;
-
default: /* oops */
elog(ERROR, "unrecognized alter table type: %d",
(int) cmd->subtype);
@@ -4524,12 +4518,6 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
/* This command never recurses */
pass = AT_PASS_MISC;
break;
- case AT_AlterCollationRefreshVersion: /* ALTER COLLATION ... REFRESH
- * VERSION */
- ATSimplePermissions(rel, ATT_INDEX);
- /* This command never recurses */
- pass = AT_PASS_MISC;
- break;
case AT_SetStorage: /* ALTER COLUMN SET STORAGE */
ATSimplePermissions(rel, ATT_TABLE | ATT_MATVIEW | ATT_FOREIGN_TABLE);
ATSimpleRecursion(wqueue, rel, cmd, recurse, lockmode, context);
@@ -5139,11 +5127,6 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab,
case AT_DetachPartitionFinalize:
ATExecDetachPartitionFinalize(rel, ((PartitionCmd *) cmd->def)->name);
break;
- case AT_AlterCollationRefreshVersion:
- /* ATPrepCmd ensured it must be an index */
- Assert(rel->rd_rel->relkind == RELKIND_INDEX);
- ATExecAlterCollationRefreshVersion(rel, cmd->object);
- break;
default: /* oops */
elog(ERROR, "unrecognized alter table type: %d",
(int) cmd->subtype);
@@ -18627,20 +18610,6 @@ ATDetachCheckNoForeignKeyRefs(Relation partition)
}
/*
- * ALTER INDEX ... ALTER COLLATION ... REFRESH VERSION
- *
- * Update refobjversion to the current collation version by force. This clears
- * warnings about version mismatches without the need to run REINDEX,
- * potentially hiding corruption due to ordering changes.
- */
-static void
-ATExecAlterCollationRefreshVersion(Relation rel, List *coll)
-{
- index_update_collation_versions(rel->rd_id, get_collation_oid(coll, false));
- CacheInvalidateRelcache(rel);
-}
-
-/*
* resolve column compression specification to compression method.
*/
static char