Re: Re: pgsql: Fix assorted inconsistencies in GIN opclass support function dec - Mailing list pgsql-committers

From Alexander Korotkov
Subject Re: Re: pgsql: Fix assorted inconsistencies in GIN opclass support function dec
Date
Msg-id CAPpHfdt=ASL5JbBqL9Va2Q4kN_dFzH0bpPm6jpch_VPycE3bOA@mail.gmail.com
Whole thread Raw
In response to Re: Re: pgsql: Fix assorted inconsistencies in GIN opclass support function dec  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Tue, May 3, 2016 at 4:32 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> On Tue, May 3, 2016 at 12:09 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It doesn't really matter, though, because there simply isn't any need to
>> refer to these functions from SQL.

> What if we'll want to reuse some on these functions in new opclass?

What context do you imagine that happening in?  Surely no other extension
would attempt to re-use them.  If, say, hstore itself wanted to reuse
these functions, that would be in a new version of hstore--n.n.sql, so
there's no problem.

Let's consider particular example: gin_extract_hstore() function.

In PostgreSQL 9.6 hstore 1.3 it's gin_extract_hstore(hstore, internal) RETURNS internal.
In PostgreSQL 9.5 hstore 1.3 it's gin_extract_hstore(internal, internal) RETURNS internal.
After pg_upgrade 9.5 => 9.6 it will be still gin_extract_hstore(internal, internal) RETURNS internal.

Thus, in 9.6 hstore 1.3 we can meet either
  1. gin_extract_hstore(internal, internal) RETURNS internal
  2. gin_extract_hstore(hstore, internal) RETURNS internal
Then, if we want to reuse this function in hstore 1.4, we will need to write a migration script hstore--1.3--1.4.sql.  How can we refer gin_extract_hstore() function from this script?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Fix more things to be parallel-safe.
Next
From: Peter Eisentraut
Date:
Subject: pgsql: doc: Fix typos