On Tue, May 3, 2016 at 4:32 PM, Tom Lane <[email protected]> wrote:

> Alexander Korotkov <[email protected]> writes:
> > On Tue, May 3, 2016 at 12:09 AM, Tom Lane <[email protected]> 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

Reply via email to