[PHP-DEV] Bumping minimum PostgreSQL version to 10.0

Hello,

we're thinking of bumping the minimum PostgreSQL version supported by PHP from
current version 9.1 to version 10.0:

A list of PostgreSQL versions and their EOL dates can be seen at

The versions coverage by Linux/Unix distributions can be found at
https://pkgs.org

For example:
- https://pkgs.org/search/?q=libpq
and
- https://pkgs.org/search/?q=postgresql

This is aligning with CentOS 7 EOL in June 2024 and CentOS 8. PostgreSQL 10 is
already EOL but to provide easier migration for packages, I think such
increase is ok.

Anyone have any concerns or thoughts about this?

Le 14/06/2024 à 22:54, Peter Kokot a écrit :

Hello,

we're thinking of bumping the minimum PostgreSQL version supported by PHP from
current version 9.1 to version 10.0:
Add optional pkg-config support for PostgreSQL by petk · Pull Request #14540 · php/php-src · GitHub

A list of PostgreSQL versions and their EOL dates can be seen at
PostgreSQL - Wikipedia

The versions coverage by Linux/Unix distributions can be found at
https://pkgs.org

For example:
- https://pkgs.org/search/?q=libpq
and
- https://pkgs.org/search/?q=postgresql

This is aligning with CentOS 7 EOL in June 2024 and CentOS 8. PostgreSQL 10 is
already EOL but to provide easier migration for packages, I think such
increase is ok.

Anyone have any concerns or thoughts about this?

Would id affect the possibility to use an old PostgreSQL (eg. 9.6) via PHP (PDO or ext-pgsql) ?

If so, it might be a dangerous move for oldest projects, you sometime can upgrade PHP and your software easily, but can't upgrade the database server.

Regards,

Pierre

Hi,

Il 14/06/2024 22:54, Peter Kokot ha scritto:

Hello,

we're thinking of bumping the minimum PostgreSQL version supported by PHP from
current version 9.1 to version 10.0:
Add optional pkg-config support for PostgreSQL by petk · Pull Request #14540 · php/php-src · GitHub

Anyone have any concerns or thoughts about this?

I'm very happy with it.

Cheers
--
Matteo Beccati

Development & Consulting - http://www.beccati.com/

On Fri, Jun 14, 2024, at 8:54 PM, Peter Kokot wrote:

Hello,

we're thinking of bumping the minimum PostgreSQL version supported by PHP from
current version 9.1 to version 10.0:
Add optional pkg-config support for PostgreSQL by petk · Pull Request #14540 · php/php-src · GitHub

A list of PostgreSQL versions and their EOL dates can be seen at
PostgreSQL - Wikipedia

The versions coverage by Linux/Unix distributions can be found at
https://pkgs.org

For example:
- https://pkgs.org/search/?q=libpq
and
- https://pkgs.org/search/?q=postgresql

This is aligning with CentOS 7 EOL in June 2024 and CentOS 8. PostgreSQL 10 is
already EOL but to provide easier migration for packages, I think such
increase is ok.

Anyone have any concerns or thoughts about this?

No objection. Thanks.

--Larry Garfield

On Mon, 17 Jun 2024 at 18:58, Pierre <pierre-php@processus.org> wrote:

Would id affect the possibility to use an old PostgreSQL (eg. 9.6) via
PHP (PDO or ext-pgsql) ?

If so, it might be a dangerous move for oldest projects, you sometime
can upgrade PHP and your software easily, but can't upgrade the database
server.

Regards,

Pierre

Yes, after such version increase it would affect PDO PGSQL extension
also and you'd need to upgrade the database. In the PR there is also
9.6 mentioned as one version earlier as an alternative. I'm fine with
9.6 also but PHP-8.4-dev code will need to be adjusted further.

Hi,

Il 17/06/2024 19:03, Peter Kokot ha scritto:

On Mon, 17 Jun 2024 at 18:58, Pierre <pierre-php@processus.org> wrote:

Would id affect the possibility to use an old PostgreSQL (eg. 9.6) via
PHP (PDO or ext-pgsql) ?

If so, it might be a dangerous move for oldest projects, you sometime
can upgrade PHP and your software easily, but can't upgrade the database
server.

Regards,

Pierre

Yes, after such version increase it would affect PDO PGSQL extension
also and you'd need to upgrade the database. In the PR there is also
9.6 mentioned as one version earlier as an alternative. I'm fine with
9.6 also but PHP-8.4-dev code will need to be adjusted further.

Please correct me if I'm wrong, but the basic capability of connecting to an older version shouldn't be compromised. It's only the build process requiring libpq > 10.

Cheers
--
Matteo Beccati

Development & Consulting - http://www.beccati.com/

On Mon, 17 Jun 2024 at 19:16, Matteo Beccati <php@beccati.com> wrote:

Hi,

Il 17/06/2024 19:03, Peter Kokot ha scritto:
> On Mon, 17 Jun 2024 at 18:58, Pierre <pierre-php@processus.org> wrote:
>>
>> Would id affect the possibility to use an old PostgreSQL (eg. 9.6) via
>> PHP (PDO or ext-pgsql) ?
>>
>> If so, it might be a dangerous move for oldest projects, you sometime
>> can upgrade PHP and your software easily, but can't upgrade the database
>> server.
>>
>> Regards,
>>
>> Pierre
>
> Yes, after such version increase it would affect PDO PGSQL extension
> also and you'd need to upgrade the database. In the PR there is also
> 9.6 mentioned as one version earlier as an alternative. I'm fine with
> 9.6 also but PHP-8.4-dev code will need to be adjusted further.

Please correct me if I'm wrong, but the basic capability of connecting
to an older version shouldn't be compromised. It's only the build
process requiring libpq > 10.

Cheers
--
Matteo Beccati

Development & Consulting - http://www.beccati.com/

When building for a certain PostgreSQL version, the pq library gets
linked to the extension and then this PostgreSQL version needs to be
used, yes. If you build for 10.0, then you need to use that exact
version. Linux packages have this resolved by dependencies on the
packages so when you install the extension it will work for that
distribution PostgreSQL package.

Hi,

Il 17/06/2024 19:21, Peter Kokot ha scritto:

When building for a certain PostgreSQL version, the pq library gets
linked to the extension and then this PostgreSQL version needs to be
used, yes. If you build for 10.0, then you need to use that exact
version. Linux packages have this resolved by dependencies on the
packages so when you install the extension it will work for that
distribution PostgreSQL package.

Sure, you need to have the same version of libpq that PHP was built with. But nothing prevents your script using pdo_pgsql or ext/pgsql to connect to another version of postgres running either on the same machine or a different one.

Cheers
--
Matteo Beccati

Development & Consulting - http://www.beccati.com/

Hi, I m all for the changes this update should not preclude any 10.0 client to connect to a 9.x server. cheers.

On 2024-06-18 05:25, Matteo Beccati wrote:

Hi,

Sure, you need to have the same version of libpq that PHP was built with. But nothing prevents your script using pdo_pgsql or ext/pgsql to connect to another version of postgres running either on the same machine or a different one.

Right; the wire protocol between a (PostgreSQL 16) libpq-based client and the server is the same going back to PostgreSQL 7.4: if your server is older than that you'll have trouble, but we already require 9.1 (probably because of pg_version()'s use of PQlibVersion to get the client library version).