Re: Add version macro to libpq-fe.h

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Boris Kolpackov <boris(at)codesynthesis(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Álvaro Herrera <alvaro(dot)herrera(at)2ndquadrant(dot)com>
Subject: Re: Add version macro to libpq-fe.h
Date: 2021-06-17 19:47:22
Message-ID: 20210617194722.GI31772@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 17, 2021 at 08:15:42PM +0100, Dagfinn Ilmari Mannsåker wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> > Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> >> I just went and looked at how exports.txt has evolved over the years.
> >> Since PostgreSQL 8.1, every release except for 9.4 and 11 added at
> >> least one new function to libpq. That means in 14 releases we've done
> >> something that might break someone's compile 12 times. Now maybe you
> >> want to try to argue that few of those changes are "major," but I
> >> don't know how that could be a principled argument. Every new function
> >> is something someone may want to use, and thus a potential compile
> >> break.
> >
> > Interesting, but then you have to explain why this is the first time
> > that somebody has asked for a version number in libpq-fe.h. Maybe
> > all those previous additions were indeed minor enough that the
> > problem didn't come up. (Another likely possibility, perhaps, is
> > that people have been misusing the server version for this purpose,
> > and have been lucky enough to not have that approach fail for them.)
>
> FWIW, the perl DBD::Pg module extracts the version number from
> `pg_config --version` at build time, and uses that to define a

pygresql is also using pg_config --version:

setup.py- wanted = self.escaping_funcs
setup.py: supported = pg_version >= (9, 0)
--
setup.py- wanted = self.pqlib_info
setup.py: supported = pg_version >= (9, 1)
--
setup.py- wanted = self.ssl_info
setup.py: supported = pg_version >= (9, 5)
--
setup.py- wanted = self.memory_size
setup.py: supported = pg_version >= (12, 0)

--
Justin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-06-17 19:47:33 Re: Add version macro to libpq-fe.h
Previous Message Alexander Korotkov 2021-06-17 19:28:36 Re: unnesting multirange data types