PostgreSQL 9.2beta2 と DBD::Pg

PostgreSQL 9.2beta2 を入れてみたら、DBIx::Class::Schema::Loader 付属の dbicdump でエラーになった。DBD::Pg の中でエラーになってる。

調べてみると PostgreSQL 9.2 で pg_tablespace.spclocation がなくなったのが原因と判明。→ http://archives.postgresql.org/pgadmin-hackers/2012-04/msg00044.php

ということで、DBD/Pg.pm を2行ほど書き換えたら動くようになりました。

% diff -c Pg.pm.orig Pg.pm
*** Pg.pm.orig  2012-07-09 14:43:14.810389674 +0900
--- Pg.pm       2012-07-09 14:52:12.815648538 +0900
***************
*** 727,733 ****
                  , quote_ident(n.nspname)
                  , quote_ident(c.relname)
                  , quote_ident(c2.relname)
!                 , i.indkey, quote_ident(t.spcname), quote_ident(t.spclocation)
                  , n.nspname, c.relname, c2.relname
              FROM
                  pg_catalog.pg_class c
--- 727,733 ----
                  , quote_ident(n.nspname)
                  , quote_ident(c.relname)
                  , quote_ident(c2.relname)
!                 , i.indkey, quote_ident(t.spcname), quote_ident(pg_tablespace_location(t.oid))
                  , n.nspname, c.relname, c2.relname
              FROM
                  pg_catalog.pg_class c
***************
*** 1151,1157 ****
                        # Default SQL
                        $extracols = q{,n.nspname AS pg_schema, c.relname AS pg_table};
                        my @search;
!                       my $showtablespace = ', quote_ident(t.spcname) AS "pg_tablespace_name", quote_ident(t.spclocation) AS "pg_tablespace_location"';

                        ## If the schema or table has an underscore or a %, use a LIKE comparison
                        if (defined $schema and length $schema) {
--- 1151,1157 ----
                        # Default SQL
                        $extracols = q{,n.nspname AS pg_schema, c.relname AS pg_table};
                        my @search;
!                       my $showtablespace = ', quote_ident(t.spcname) AS "pg_tablespace_name", quote_ident(pg_tablespace_location(t.oid)) AS "pg_tablespace_location"';

                        ## If the schema or table has an underscore or a %, use a LIKE comparison
                        if (defined $schema and length $schema) {

追記

DBD::Pg 2.19.3 で対応されましたね。