8 my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
10 $dsn = 'dbi:Pg:dbname=postgres;host=localhost' unless $dsn;
11 $dbuser = 'postgres' unless $dbuser;
12 $dbpass = 'postgres' unless $dbpass;
14 plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
15 unless ($dsn && $dbuser);
19 DBICTest::Schema->compose_connection('PGTest' => $dsn, $dbuser, $dbpass);
21 my $dbh = PGTest->schema->storage->dbh;
27 artistid serial NOT NULL PRIMARY KEY,
31 ],{ RaiseError => 1, PrintError => 1 });
34 PGTest::Artist->load_components(qw/
40 PGTest::Artist->add_columns(
49 # test primary key handling
50 my $big_long_string = 'abcd' x 250000;
52 my $new = PGTest::Artist->create({ media => $big_long_string });
54 ok($new->artistid, "Created a blob row");
55 is($new->media, $big_long_string, "Set the blob correctly.");
57 my $rs = PGTest::Artist->find({artistid=>$new->artistid});
59 is($rs->get_column('media'), $big_long_string, "Created the blob correctly.");
61 $dbh->do("DROP TABLE artist");