Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit84eca14

Browse files
committed
Remove ancient hacks to ignore certain opclass names in CREATE INDEX.
Twenty years ago, we removed certain operator classes in favor ofletting indexes over their data types be built with some otherbinary-compatible, more standard opclass. As a hack to allow existingindex definitions to be dumped and reloaded, we made CREATE INDEX ignorethe removed opclass names, so that such indexes would fall back to thenew default opclass for their data types. This was never intended tobe a long-lived thing; it carries the obvious risk of breaking somefuture developer's attempt to re-use those old opclass names. Sinceall of the cases in question are for opclasses that were removedbefore 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 klugesfor transparently upgrading pre-8.0 dump files. Since we've had fewcomplaints about dropping pg_dump's support for dumping from pre-8.0servers (commit64f3524), it seems okay to now remove these kluges.Discussion:https://postgr.es/m/3685.1583422389@sss.pgh.pa.us
1 parente58a599 commit84eca14

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

‎src/backend/commands/indexcmds.c

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
18361836
/*
18371837
* Resolve possibly-defaulted operator class specification
18381838
*
1839-
* Note: This is used to resolve operator classspecification in index and
1839+
* Note: This is used to resolve operator classspecifications in index and
18401840
* partition key definitions.
18411841
*/
18421842
Oid
@@ -1850,34 +1850,6 @@ ResolveOpClass(List *opclass, Oid attrType,
18501850
OidopClassId,
18511851
opInputType;
18521852

1853-
/*
1854-
* Release 7.0 removed network_ops, timespan_ops, and datetime_ops, so we
1855-
* ignore those opclass names so the default *_ops is used. This can be
1856-
* removed in some later release. bjm 2000/02/07
1857-
*
1858-
* Release 7.1 removes lztext_ops, so suppress that too for a while. tgl
1859-
* 2000/07/30
1860-
*
1861-
* Release 7.2 renames timestamp_ops to timestamptz_ops, so suppress that
1862-
* too for awhile. I'm starting to think we need a better approach. tgl
1863-
* 2000/10/01
1864-
*
1865-
* Release 8.0 removes bigbox_ops (which was dead code for a long while
1866-
* anyway). tgl 2003/11/11
1867-
*/
1868-
if (list_length(opclass)==1)
1869-
{
1870-
char*claname=strVal(linitial(opclass));
1871-
1872-
if (strcmp(claname,"network_ops")==0||
1873-
strcmp(claname,"timespan_ops")==0||
1874-
strcmp(claname,"datetime_ops")==0||
1875-
strcmp(claname,"lztext_ops")==0||
1876-
strcmp(claname,"timestamp_ops")==0||
1877-
strcmp(claname,"bigbox_ops")==0)
1878-
opclass=NIL;
1879-
}
1880-
18811853
if (opclass==NIL)
18821854
{
18831855
/* no operator class specified, so find the default */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp