Subject: | Incompatibility between postgres 9.2 and DBD:Pg (table_info and primary_key_info) |
Date: | Thu, 05 Sep 2013 16:02:39 +0200 |
To: | bug-DBD-Pg [...] rt.cpan.org |
From: | Casper Joost Eyckelhof <joost [...] quarantainenet.nl> |
Summary: DBD::Pg generates queries that reference a no longer existing
field (in postgres 9.2)
Seen on DBD::Pg versions packaged with Debian Squeeze and Debian Wheezy,
but "incompatible code" is still there in latest DBD:Pg (DBD-Pg-2.19.3).
Error:
DBD::Pg::db table_info failed: ERROR: column t.spclocation does not exist
LINE 11: ...t(t.spcname) AS "pg_tablespace_name", quote_ident(t.spclocat...
Changelog from postgres 9.2 states:
( http://www.postgresql.org/docs/9.2/interactive/release-9-2.html )
"E.5.2.1. System Catalogs
Remove the spclocation field from pg_tablespace (Magnus Hagander)
This field was duplicative of the symbolic links that actually
define tablespace locations, and thus risked errors of omission when
moving a tablespace. This change allows tablespace directories to be
moved while the server is down, by manually adjusting the symbolic
links. To replace this field, we have added pg_tablespace_location() to
allow querying of the symbolic links."
Quick fix for postgres 9.2 is replacing "quote_ident(t.spclocation)" by
"quote_ident(pg_tablespace_location(t.oid))" at least twice in DBD::Pg,
in the functions table_info and primary_key_info.
But this will probably break things for postgres <= 9.1.
--
Regards,
Casper Joost Eyckelhof
Quarantainenet BV
The Netherlands