Skip to content
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

Support Postgres 15 and beyond #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Steveorevo
Copy link

Doesn't seem to work with Postgres 15, a default to the case statement seems to resolve this and may address future major incompatibilities.

@ReimuHakurei
Copy link

This is actually a bug from the intended behavior (intended behavior has always been to default to the latest driver for an unknown PostgreSQL version).

The problem is with the check to make sure PostgreSQL is version 7.4 or newer -- it does this by checking the first digit of the version string and making sure it's >= 8 (7.4 and 7.5 were already handled further up in the function):

if ((int)substr($version, 0, 1) < 8)
	return null;

The problem is that with PostgreSQL 10+, the first digit is always 1, so this breaks for any version not specifically defined.

The proper fix is to replace that check with something like the following:

$floatVer = floatval(explode(' ', $version)[0]);
if ($floatVer < 7.4) {
	return null;
}

Note that this repository has been dead for several years now, so the chance someone will come to accept your PR at this point is probably close to zero, unfortunately.

You will find existing fixes for this issue and quite a few more in my fork if you want, though: https://github.com/ReimuHakurei/phpPgAdmin/releases

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.

None yet

2 participants