Re: Shared PostgreSQL libraries and symbol versioning

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Pavel Raiskup <praiskup(at)redhat(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Shared PostgreSQL libraries and symbol versioning
Date: 2018-04-09 20:23:44
Message-ID: 20180409202343.GK27724@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

* Peter Eisentraut (peter(dot)eisentraut(at)2ndquadrant(dot)com) wrote:
> On 4/5/18 02:04, Pavel Raiskup wrote:
> > Hello, for the support of multiple versions of PostgreSQL RPM packages on
> > one system, we are thinking about having only one libpq.so.5
> > (libecpg.so.6, libpgtype.so.3 respectively) supported and about building
> > (linking) all the PostgreSQL package versions against that. The pattern
> > would mean that we'd have to update the system-wide libraries before
> > adding support for new PostgreSQL major version and that the older
> > packages (say version =< 9.6) would be run against libs from newer PG
> > package (say libpq.so.5 from v10).
> >
> > Do you think it is a good idea in general?
>
> yes

Adding symbol versioning would probably be a good idea, yes, though we
don't have as much need as others since we've really had a rather stable
ABI for a long time.

> > As a followup thought; there are probably two major obstacles ATM
> >
> > - the DSOs' symbols are not yet versioned, and
> > - the build-system doesn't seem to know how to -lpq link against
> > external libpq.so

I've not looked but neither of those strike me as terribly difficult to
overcome, assuming they need to be overcome.

> It's not clear to me why you would need these, given that Debian has
> been doing this for many years without this.

Huh?

objdump -T /usr/lib/x86_64-linux-gnu/libpq.so.5.10

...
0000000000021a50 g DF .text 000000000000014c Base pg_char_to_encoding
00000000000270d0 g DF .text 000000000000002c Base PQsslStruct
0000000000013880 g DF .text 00000000000001d2 Base PQmakeEmptyPGresult
0000000000017900 g DF .text 0000000000000012 Base PQmblen
000000000000ac20 g DF .text 00000000000002c0 Base PQencryptPasswordConn
000000000000fcc0 g DF .text 00000000000000f3 Base PQresetPoll
0000000000014790 g DF .text 00000000000000ef Base PQsendQuery
000000000001fc50 g DF .text 0000000000000061 Base initPQExpBuffer
00000000000152a0 g DF .text 0000000000000012 Base PQsendDescribePortal
...

No, Debian doesn't do symbol versioning for libpq and I don't believe it
ever has.

There are other libraries in Debian where the are using symbol
versioning, of course, but libpq isn't one of those.

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2018-04-09 20:25:54 Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS
Previous Message Peter Eisentraut 2018-04-09 20:15:54 Re: Shared PostgreSQL libraries and symbol versioning