Error on creating database in phppgadmin

Gagan Deep picture Gagan Deep · Nov 20, 2012 · Viewed 12.3k times · Source

I have PostgreSQL 9.2.0. On clicking create database it shows following error:

SQL error:
ERROR:  column "spclocation" does not exist
LINE 1: ...pg_catalog.pg_get_userbyid(spcowner) AS spcowner, spclocatio...
                                                         ^
In statement:

SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, spclocation,
       (SELECT description FROM pg_catalog.pg_shdescription pd WHERE pg_tablespace.oid=pd.objoid) AS spccomment
        FROM pg_catalog.pg_tablespace WHERE spcname NOT LIKE $$pg\_%$$ ORDER BY spcname

Answer

Aimagu picture Aimagu · Feb 13, 2013

Quick Fix: (worked with my Version (5.0.3) / pg 9.2.3 )

  1. change to /classes/database
  2. copy Postgres84.php to Postgres92.php
  3. open Connection.php
  4. add a line case '9.2': return 'Postgres92'; break; at the // Detect version and choose appropriate database driver switch.
  5. open Postgres.php and copy functions getTablespaces + getTablespace
  6. open Postgres92.php and paste the functions into the class
  7. replace ", spclocation," with ", pg_tablespace_location(oid) as spclocation," in both functions.

  8. in Postgres92.php change class name to Postgres92