pgsql: Create btree_gist v1.9, in which inet/cidr opclasses aren't defa
| От | Tom Lane |
|---|---|
| Тема | pgsql: Create btree_gist v1.9, in which inet/cidr opclasses aren't defa |
| Дата | |
| Msg-id | E1vdvOV-005MCA-2R@gemulon.postgresql.org обсуждение исходный текст |
| Список | pgsql-committers |
Create btree_gist v1.9, in which inet/cidr opclasses aren't default. btree_gist's gist_inet_ops and gist_cidr_ops opclasses are fundamentally broken: they rely on an approximate representation of the inet values and hence sometimes miss rows they should return. We want to eventually get rid of them altogether, but as the first step on that journey, we should mark them not-opcdefault. To do that, roll up the preceding deltas since 1.2 into a new base script btree_gist--1.9.sql. This will allow installing 1.9 without going through a transient situation where gist_inet_ops and gist_cidr_ops are marked as opcdefault; trying to create them that way will fail if there's already a matching default opclass in the core system. Additionally provide btree_gist--1.8--1.9.sql, so that a database that's been pg_upgraded from an older version can be migrated to 1.9. I noted along the way that commit 57e3c5160 had missed marking the gist_bool_ops support functions as PARALLEL SAFE. While that probably has little harmful effect (since AFAIK we don't check that when calling index support functions), this seems like a good time to make things consistent. Readers will also note that I removed the former habit of installing some opclass operators/functions with ALTER OPERATOR FAMILY, instead just rolling them all into the CREATE OPERATOR CLASS steps. The comment in btree_gist--1.2.sql that it's necessary to use ALTER for pg_upgrade reproducibility has been obsolete since we invented the amadjustmembers infrastructure. Nowadays, gistadjustmembers will force all operators and non-required support functions to have "soft" opfamily dependencies, regardless of whether they are installed by CREATE or ALTER. Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://postgr.es/m/2483812.1754072263@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b3b0b45717ef37205b301ae78e288ebeb43fe486 Modified Files -------------- contrib/btree_gist/Makefile | 3 +- contrib/btree_gist/btree_gist--1.8--1.9.sql | 40 + contrib/btree_gist/btree_gist--1.9.sql | 1971 +++++++++++++++++++++++++++ contrib/btree_gist/btree_gist.control | 2 +- contrib/btree_gist/expected/cidr.out | 2 +- contrib/btree_gist/expected/inet.out | 2 +- contrib/btree_gist/meson.build | 2 + contrib/btree_gist/sql/cidr.sql | 2 +- contrib/btree_gist/sql/inet.sql | 2 +- 9 files changed, 2020 insertions(+), 6 deletions(-)
В списке pgsql-committers по дате отправления: