I’m updating a Linux server with a new version of PostgreSql and I have an Error Message in phpPgAdmin when I browse a table.
The Ubuntu 18.04.3 LTS server running Apache 2.4.41, PHP 7.3.11 and when I update to PostgreSQL 12.0 and phpPgAdmin 7.12.0 the error occurs. With PostgreSQL 11.5 and phpPgAdmin 5.6 I didn’t have this problem.
I expect to visualize the data stored in the table using phpPgAdmin, but the actual output is:
SQL error:
ERROR: column «relhasoids» does not exist
LINE 1: SELECT relhasoids FROM pg_catalog.pg_class WHERE relname='pr...
In statement:
SELECT relhasoids FROM pg_catalog.pg_class WHERE relname='product'
AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname='public')
3
Answers
Editing the file /usr/share/phppgadmin/classes/database/Postgres.php and comment
line 1045 to line 1054
the error disappears:This is because phpPgAdmin is not compatible with PostgreSQL v. 12. PostgreSQL v. 12 has removed the
relhasoids
column because of the new way that OIDs are handled. As of the time of this post, pgPgAdmin does not support PostgreSQL v. 12 (it is not listed on the website). You may need to look into alternate clients.See also How to fix “ERROR: column c.relhasoids does not exist” in Postgres?
This column does not exist anymore, since you cannot create tables with OID any longer.
From the documentation: