Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 87291
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: frank [...] lichtenheld.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.07035
Fixed in: 0.07037



Subject: Doesn't work anymore on PostgreSQL 8.3
One of the last updates seems to have dropped compatibility to PostgreSQL 8.3. Specifically _table_fk_info doesn't work anymore: DBIx::Class::Schema::Loader::DBI::Pg::_table_fk_info(): DBI Exception: DBD::Pg::st execute failed: ERROR: syntax error at or near "from_col" LINE 1: ..._name, q.to_schema, q.to_table, from_cols.attname from_col, ... ^ [for Statement "select q.constr_name, q.to_schema, q.to_table, from_cols.attname from_col, to_cols.attname to_col, q.on_delete, q.on_update, q.is_deferrable from (select constr.conname constr_name, to_ns.nspname to_schema, to_class.relname to_table, unnest(constr.conkey) from_colnum, unnest(constr.confkey) to_colnum, constr.confdeltype on_delete, constr.confupdtype on_update, constr.condeferrable is_deferrable, constr.conrelid conrelid, constr.confrelid confrelid from pg_constraint constr join pg_namespace from_ns on constr.connamespace = from_ns.oid join pg_class from_class on constr.conrelid = from_class.oid and from_class.relnamespace = from_ns.oid join pg_class to_class on constr.confrelid = to_class.oid join pg_namespace to_ns on to_class.relnamespace = to_ns.oid where from_ns.nspname = ? and from_class.relname = ? and from_class.relkind = 'r' and constr.contype = 'f' ) q join pg_attribute from_cols on from_cols.attrelid = q.conrelid and from_cols.attnum = q.from_colnum join pg_attribute to_cols on to_cols.attrelid = q.confrelid and to_cols.attnum = q.to_colnum; Once I fix it to use "AS" it complains about missing unnest(). Could it made to work again for PostgreSQL 8.3? Otherwise maybe you could at least document the requirement in DBIx::Class::Schema::Loader::DBI::Pg. Thanks, Frank
Inspired by changes I was making to DBD::Pg's foreign_key_info, I've now rewritten the query in _table_fk_info to not use unnest(), and verified that it works on every version from 8.3 to 9.3. This change is commit b5f68cb, and will be in the next release. https://github.com/dbsrgits/dbix-class-schema-loader/commit/b5f68c
Version 0.07037 has been released with the fix.