Error creating database in phppgadmin

I have PostgreSQL 9.2.0. When you click on the database creation, the following error appears:

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 
+7
source share
4 answers

I updated Mountain Lion on my Mac Mini Server on the evening of 12/12/2012, where PostgreSQL 9.2.1 works. I had the same problem when I found this question. When I did a search on this issue, I found the following error tracker on this issue.

http://sourceforge.net/tracker/?func=detail&aid=3570272&group_id=37132&atid=418980

One comment suggests downloading the developer branch from github to get around this from https://github.com/phppgadmin/phppgadmin/zipball/master . I did this and copied the file / Library / Server / Web / Data / Sites / Default and renamed the folder. I changed $ conf ['servers'] [0] ['host'] to 127.0.0.1 in /conf/config.inc.php. I think I had to copy config.inc.php-dist. I managed to create databases. As of 12/12, they have not released a stable version for 9.2. I hope they are soon.

+4
source

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

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

  • in Postgres92.php change the class name to Postgres92

+13
source

In short: table pg_tablespace does not have this column in 9.2 .

It seems that the information should be obtained from other means, as indicated on the mailing list .

Also note how on the official phpPgAdmin page the latest version supported by PostgreSQL is 9.0.

+2
source

And for a β€œquick fix,” add another step after (2):

Change the class name in Postgres92.php from Postgres84 to Postgres92.

+1
source

All Articles