This commit was generated by cvs2svn to compensate for changes in r3921,
[freeside.git] / install / 5.005 / DBD-Pg-1.22-fixvercmp / t / 01setup.t
1 use strict;
2 use DBI;
3 use Test::More;
4
5 if (defined $ENV{DBI_DSN}) {
6   plan tests => 3;
7 } else {
8   plan skip_all => 'cannot test without DB info';
9 }
10
11 my $dbh = DBI->connect($ENV{DBI_DSN}, $ENV{DBI_USER}, $ENV{DBI_PASS},
12                     {RaiseError => 1, AutoCommit => 1});
13 ok(defined $dbh,'connect without transaction');
14 {
15   local $dbh->{PrintError} = 0;
16   local $dbh->{RaiseError} = 0;
17   $dbh->do(q{DROP TABLE test});
18 }
19
20 my $sql = <<SQL;
21 CREATE TABLE test (
22   id int,
23   name text,
24   val text,
25   score float,
26   date timestamp default 'now()',
27   array text[][]
28 )
29 SQL
30
31 ok($dbh->do($sql),
32    'create table'
33   );
34
35 ok($dbh->disconnect(),
36    'disconnect'
37   );
38