Environment - Perl: Ububtu 12.04; Perl 5.14.2; all packages installed via .debs. Database: postgres database on a Sun server.

I am using dbicdump to create a pile of DBIx::Class packages to access a database... and a few of tables are not coming through cleanly.

For example - If I query my database through psql, I get:

oarj3=> select column_name,data_type from information_schema.columns w +here table_name like 'urls'; column_name | data_type -----------------+------------------- date_checked | date http_code | integer base_uri | text host_alive | boolean last_check_good | boolean count_fails | integer count_success | integer pri | boolean url | text table_id | integer tbl | character varying id | integer (12 rows)

When I run the following dbicddump command

dbicdump -o dump_directory=./lib/perl -o debug=1 EDINA::ORI dbi:Pg:dbname=oarj3;host=[host];port=[port] [username] [password]

I get the following extract in Url.pm:

__PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0, sequence => "urls_id_seq", }, "table", { accessor => undef, data_type => "varchar", is_nullable => 0, size +=> 20 }, "table_id", { data_type => "integer", is_nullable => 0 }, "url", { data_type => "text", is_nullable => 0 }, "primary", { data_type => "boolean", default_value => \"false", is_nullable => +0 }, );

First off.... the column "tbl" has become "table", and unaccessable - which is a bit of a problem, but easily solvable.

However the bigger problem is that I'm missing 7 columns!

The interesting part is that this is happening to my 'urls' table (12 rows), my 'name' table (drops the final "pri" column), and my 'org' table (8 rows: drops 6!), but not my 'repo' table (15 columns) or my 'sword' table (6 columns)

I've looked at the debug output, and it doesn't seem to be listing the columns:

EDINA::ORI::Result::Url->table("urls"); Column 'table' in table 'urls' collides with an inherited method. See "COLUMN ACCESSOR COLLISIONS" in perldoc DBIx::Class::Schema::Loade +r::Base . EDINA::ORI::Result::Url->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0, sequence => "urls_id_seq", }, "table", { accessor => undef, data_type => "varchar", is_nullable => 0, size +=> 20 }, "table_id", { data_type => "integer", is_nullable => 0 }, "url", { data_type => "text", is_nullable => 0 }, "primary", { data_type => "boolean", default_value => \"false", is_nullable => +0 }, ); DBIx::Class::Schema::Loader::make_schema_at(): urls has no primary key + at /usr/local/bin/dbicdump line 178

Just to add confusion here - I've another database (same name) on a different postgres server (different port), and I know it's not being referenced as it has different fields in its tables, and they're not being imported.

I've looked and looked, rerun and compared, and even spoken to a teddybear.... Other than hand-coding the missing data into the records, is there something I've missed?

Is there an obvious reason the data is not being build correctly?



-- Ian Stuart
A man depriving some poor village, somewhere, of a first-class idiot.

In reply to dbicdump not importing the full table (Postgres) by kiz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.