in reply to Database abstraction including data types
Hardly a complete answer, but handy for the particular true/false problem that you mention is, for the postgres side: $dbh->{pg_bool_tf}, which lets you choose between t/f or 1/0:
$ perl -Mstrict -MDBI -E 'my$dbh=DBI->connect("dbi:Pg:"); $dbh->{pg_bool_tf} = 0; # true false is now 1/0 print $dbh->selectall_arrayref("select 1=1")->[0]->[0], "\n"; $dbh->{pg_bool_tf} = 1; # true false is now t/f print $dbh->selectall_arrayref("select 1=1")->[0]->[0], "\n"; # ' output: 1 t
(See DBD::Pg $dbh attributes.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Database abstraction including data types
by Anonymous Monk on May 20, 2012 at 21:00 UTC | |
by Anonymous Monk on May 20, 2012 at 21:06 UTC | |
by mbethke (Hermit) on May 22, 2012 at 05:36 UTC | |
Re^2: Database abstraction including data types
by mbethke (Hermit) on May 22, 2012 at 05:12 UTC |
In Section
Seekers of Perl Wisdom