8 my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
10 plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
11 unless ($dsn && $dbuser);
15 my $schema = DBICTest::Schema->connection($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
17 my $dbh = $schema->storage->dbh;
23 artistid serial NOT NULL PRIMARY KEY,
27 ],{ RaiseError => 1, PrintError => 1 });
30 $schema->class('Artist')->load_components(qw/
36 $schema->class('Artist')->add_columns(
45 # test primary key handling
46 my $big_long_string = 'abcd' x 250000;
48 my $new = $schema->resultset('Artist')->create({ media => $big_long_string });
50 ok($new->artistid, "Created a blob row");
51 is($new->media, $big_long_string, "Set the blob correctly.");
53 my $rs = $schema->resultset('Artist')->find({artistid=>$new->artistid});
55 is($rs->get_column('media'), $big_long_string, "Created the blob correctly.");
57 $dbh->do("DROP TABLE artist");