On Wed, 20 Sep 2000 21:24:17 -0400, Neil Conway wrote:

> I believe he is using straight Pg - the perl interface to Postgres.
> AFAIK, that's independant of DBI::Pg, which is the Postgres
> driver for DBI.
> 

ahhh!  "i see" said the blind man :)


> I agree with you, however: I've found DBD::Pg quite a bit easier
> to work with than Pg. It also gives you the possibility of
> moving your code to another database with relatively small
> changes.
> 

yes, i agree totally.  it also makes using a new database a lot
easier, since you're just calling the same functions.


> If you don't mind me commenting on your code:

not at all!

> > $user = '';
> > $pass = '';
> > $dburl = '';  # should be: dbi:Pg:dbname=[your database name]

> Is there a reason you're not using constants? e.g. 
> 
> use constant DB_USER   => 'foo';
> use constant DB_PASSWD => 'qwerty';
> 

nope.  didn't occur to me for this sort of example.  also seems to
bring in extra overhead.  is there an advantage?


> You might also want to add the "$DBI::errstr" to the error message
> on a connection failure.
> 

yeah, i used it on the other method calls.  should have put it there
as well.  i think, tho, that the driver will by default print out that
error string when it dies.


regards
--e--


Reply via email to