aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/indexcmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-03-05 15:36:06 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-03-05 15:36:06 -0500
commit84eca14bc4bdf71911cceb3a6286bc47db3a5a06 (patch)
tree0c8ba105901d568daf4facb0aabb8e3a164623b8 /src/backend/commands/indexcmds.c
parente58a5997528794687e40ec64b3c4d95a4e6cd0b0 (diff)
downloadpostgresql-84eca14bc4bdf71911cceb3a6286bc47db3a5a06.tar.gz
postgresql-84eca14bc4bdf71911cceb3a6286bc47db3a5a06.zip
Remove ancient hacks to ignore certain opclass names in CREATE INDEX.
Twenty years ago, we removed certain operator classes in favor of letting indexes over their data types be built with some other binary-compatible, more standard opclass. As a hack to allow existing index definitions to be dumped and reloaded, we made CREATE INDEX ignore the removed opclass names, so that such indexes would fall back to the new default opclass for their data types. This was never intended to be a long-lived thing; it carries the obvious risk of breaking some future developer's attempt to re-use those old opclass names. Since all of the cases in question are for opclasses that were removed before PG 8.0, it seems okay to get rid of these hacks now. This is part of a group of patches removing various server-side kluges for transparently upgrading pre-8.0 dump files. Since we've had few complaints about dropping pg_dump's support for dumping from pre-8.0 servers (commit 64f3524e2), it seems okay to now remove these kluges. Discussion: https://postgr.es/m/3685.1583422389@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r--src/backend/commands/indexcmds.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index ec20ba38d13..3f3a89fe922 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1836,7 +1836,7 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
/*
* Resolve possibly-defaulted operator class specification
*
- * Note: This is used to resolve operator class specification in index and
+ * Note: This is used to resolve operator class specifications in index and
* partition key definitions.
*/
Oid
@@ -1850,34 +1850,6 @@ ResolveOpClass(List *opclass, Oid attrType,
Oid opClassId,
opInputType;
- /*
- * Release 7.0 removed network_ops, timespan_ops, and datetime_ops, so we
- * ignore those opclass names so the default *_ops is used. This can be
- * removed in some later release. bjm 2000/02/07
- *
- * Release 7.1 removes lztext_ops, so suppress that too for a while. tgl
- * 2000/07/30
- *
- * Release 7.2 renames timestamp_ops to timestamptz_ops, so suppress that
- * too for awhile. I'm starting to think we need a better approach. tgl
- * 2000/10/01
- *
- * Release 8.0 removes bigbox_ops (which was dead code for a long while
- * anyway). tgl 2003/11/11
- */
- if (list_length(opclass) == 1)
- {
- char *claname = strVal(linitial(opclass));
-
- if (strcmp(claname, "network_ops") == 0 ||
- strcmp(claname, "timespan_ops") == 0 ||
- strcmp(claname, "datetime_ops") == 0 ||
- strcmp(claname, "lztext_ops") == 0 ||
- strcmp(claname, "timestamp_ops") == 0 ||
- strcmp(claname, "bigbox_ops") == 0)
- opclass = NIL;
- }
-
if (opclass == NIL)
{
/* no operator class specified, so find the default */