pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support the old signature of BRIN consistent function
Date: Fri, 26 Mar 2021 12:19:10 +0000
Message-ID: <E1lPlQk-0007EA-0r@gemulon.postgresql.org> (raw)

Support the old signature of BRIN consistent function

Commit a1c649d889 changed the signature of the BRIN consistent function
by adding a new required parameter.  Treating the parameter as optional,
which would make the change backwards incompatibile, was rejected with
the justification that there are few out-of-core extensions, so it's not
worth adding making the code more complex, and it's better to deal with
that in the extension.

But after further thought, that would be rather problematic, because
pg_upgrade simply dumps catalog contents and the same version of an
extension needs to work on both PostgreSQL versions. Supporting both
variants of the consistent function (with 3 or 4 arguments) makes that
possible.

The signature is not the only thing that changed, as commit 72ccf55cb9
moved handling of IS [NOT] NULL keys from the support procedures. But
this change is backward compatible - handling the keys in exension is
unnecessary, but harmless. The consistent function will do a bit of
unnecessary work, but it should be very cheap.

This also undoes most of the changes to the existing opclasses (minmax
and inclusion), making them use the old signature again. This should
make backpatching simpler.

Catversion bump, because of changes in pg_amproc.

Author: Tomas Vondra <tomas.vondra@postgresql.org>
Author: Nikita Glukhov <n.gluhov@postgrespro.ru>
Reviewed-by: Mark Dilger <hornschnorter@gmail.com>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Reviewed-by: Masahiko Sawada <masahiko.sawada@enterprisedb.com>
Reviewed-by: John Naylor <john.naylor@enterprisedb.com>
Discussion: https://postgr.es/m/c1138ead-7668-f0e1-0638-c3be3237e812@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a681e3c107aa97eb554f118935c4d2278892c3dd

Modified Files
--------------
doc/src/sgml/brin.sgml                   |  13 ++++
src/backend/access/brin/brin.c           |  60 ++++++++++++----
src/backend/access/brin/brin_inclusion.c | 116 +++++++++++--------------------
src/backend/access/brin/brin_minmax.c    |  70 +++++--------------
src/backend/access/brin/brin_validate.c  |   2 +-
src/include/catalog/catversion.h         |   2 +-
src/include/catalog/pg_proc.dat          |   4 +-
7 files changed, 121 insertions(+), 146 deletions(-)



Message-ID: <E1lPlQk-0007EA-0r@gemulon.postgresql.org>
Permalink:  ../E1lPlQk-0007EA-0r@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lPlQk-0007EA-0r@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Support the old signature of BRIN consistent function
  In-Reply-To: <E1lPlQk-0007EA-0r@gemulon.postgresql.org>
  References: <E1lPlQk-0007EA-0r@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox