Re: Syncing sql extension versions with shared library versions

From: Mat Arye <mat(at)timescaledb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Syncing sql extension versions with shared library versions
Date: 2017-07-24 15:30:02
Message-ID: CADsUR0CH167Ens3at-bOkN_3SafNDzWnzKmSB4Qjk3OW4EmJmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 22, 2017 at 10:50 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Fri, Jul 21, 2017 at 4:17 PM, Mat Arye <mat(at)timescaledb(dot)com> wrote:
> > (I
> > want to avoid having to keep backwards-compatibility for all functions in
> > future shared-libraries).
>
> Are you sure that's a good idea?

No :). But we have a lot of (most of) code that is not
user-called-functions (planner/other hooks etc.). It seems dangerous to
update that code in the .so and have it possibly affect customers that are
using old versions of the extension. While it's possible to do that kind of
_v1 suffix code for planner functions as well, this seems like a nightmare
in terms of code maintenance (we already have 1000s of lines of C code). I
think a dynamic loader might be more work upfront but have major payoffs
for speed of development in the long term for us. It may also have
advantages in terms of update safety. It's also worth noting that our C
code has some SPI upcalls, so keeping some sync between the sql and C code
is even more of an issue for us (if we can't make the dynamic/stub loader
approach work, this might be an anti-pattern and we may have to review
doing upcalls at all).

> It seems like swimming upstream
> against the design. I mean, instead of creating a dispatcher library
> that loads either v1 or v2, maybe you could just put it all in one
> library, add a "v1" or "v2" suffix to the actual function names where
> appropriate, and then set up the SQL definitions to call the correct
> one. I mean, it's the same thing, but with less chance of the dynamic
> loader ruining your day.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2017-07-24 15:40:09 Re: pg_stop_backup(wait_for_archive := true) on standby server
Previous Message Gilles Darold 2017-07-24 14:34:36 Issue with circular references in VIEW