Menu

#45 postgres issue - Synchronize database/frontend fails when CaseSensitive table names are found

0.99.3
open
nobody
None
5
2020-08-05
2020-08-05
K P
No

In postgres, "Synchronize database/frontend" fails when CaseSensitive (i.e. schemaname.PREFIX_tblname) table names are found.
The error returned is:
ERROR: relation "schemaname.prefix_tblname" does not exist

(note that "PREFIX" has been converted to lowercase in the error, which is where it crashed).

Unfortunately some other program decided to create a bunch of tables with a capitalised prefix in my schema (instead of creating its own schema or something), and to make sure it stayed capitalised, it also quoted it during creation.. now it has to ALWAYS be quoted when used in various places.

the fix was easy enough, changing class.ischema_postgres.php file, line 202 as follows.
from:
WHERE c.oid = (SELECT '{$db1['dbname']}.$table'::regclass::oid)
to:
WHERE c.oid = (SELECT '{$db1['dbname']}.\"$table\"'::regclass::oid)

will keep updating this ticket if my DB breaks other places in the application...

Discussion


Log in to post a comment.