Skip to content

Fix: PHP 8.1 pgsql change of return values #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

DanCld
Copy link

@DanCld DanCld commented Mar 21, 2025

As per https://php.watch/versions/8.1/PgSQL-resource, PostgreSQL
extension has moved away from resource objects and is now
returning opaque classes (PgSQL\Connection, Result, Lob).

These classes no longer provide default conversions to (int), so
a different approach is required, while maintaining compatibility
to older PHP versions.

As per https://php.watch/versions/8.1/PgSQL-resource, PostgreSQL
extension has moved away from resource objects and is now
returning opaque classes (PgSQL\Connection, Result, Lob).

These classes no longer provide default conversions to (int), so
a different approach is required, while maintaining compatibility
to older PHP versions.
@schengawegga
Copy link
Collaborator

Sourcecode changes looks good to me. I haven´t got any postgre database at the moment, but if there is anybody who can approve the funcionality, i will merge this PR in the master branch.

@DanCld DanCld marked this pull request as ready for review March 24, 2025 17:16
My previous commit did not check for the right result structure
before raising an exception. While looking into this, I have found
a deprecation issue with Postgresql server versions >= 12 that
needed fixing as well (adsrc column was removed).

Context and recommended replacement: https://www.postgresql.org/docs/12/release-12.html#:~:text=obsolete%20pg_attrdef.-,adsrc,-column%20(Peter%20Eisentraut
@rossnick
Copy link

My dev team looked at the code, and it's in line with what was found when we first encountered the problem with pear and PHP >= 8.1. So look's good enough for me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants