[PostgreSQL] Alter view case sensitivity problem
Database management in a single PHP file
Brought to you by:
jakubvrana
Alter view for PostgreSQL does not work if the name of view is in upper-case letters.
Example:
Trying to alter view with name VIEW_NAME leads to following error:
ERROR: relation "view_name" does not exist
If the name of view is lower-case letters alter view work ok.
I was able to reproduce this. Adminer uses pg_get_viewdef(name) which is deprecated. It should probably use
pg_get_viewdef(oid)but we would need to get the OID first.It's really a PostgreSQL bug (unlikely to be fixed as the function is deprecated). However, Adminer can get around it.