Your best shot should be DBD::pg for normal use. It is a module dependant on the DBI and it would allow you to apply some general knowledge to your specific problem. Meaning that, once you learn how to use Postgres from the DBI, you can also use whichever other database without much effort.
An alternative, useful in cases when you can't install the Postrgres client, is DBD:PgPP. From its docs:
DBD::PgPP is a Pure Perl client interface for the PostgreSQL database. This module implements network protocol between server and client of PostgreSQL, thus you don't need external PostgreSQL client library like libpq for this module to work. It means this module enables you to connect to PostgreSQL server from some operation systems which PostgreSQL is not ported.
Finally, there is DBD::ODBC, which will access your database through the ODBC interface. Be aware that, while this is a generalized approach that will smooth the differences between databases, it will aslo pre-process your queries, adding some overhead that in several cases can account to up to 20-30% of your performance.
Pg and PgSQL haven't been updated for years, and I would not start with them.
_ _ _ _
(_|| | |(_|><
_|
| [reply] [d/l] |
| [reply] |
Just for assurance - are you going to use PostgreSQL as ODBC data source? Since ODBC is a abstraction layer you don't use PostgreSQL specific libraries with it. You just use DBD::ODBC. | [reply] |
Acctually, I have hade a real problem installing that module (DBD::ODBC). It seems that it cannot find my unixODBC installation even though I've set the recommended environment variable.
DBD::Pg seems to work though..
Thanks anyway for the recommendation!
/Dargosch
| [reply] |
It was not a recommendation - it was a clarification. I don't recommend using ODBC over DBD::Pg or some other library. I just seemed to me that you need to use ODBC - and I explained that in that case you don't need DBD::Pg. Actually I would rather not use ODBC when I can - I like the DBD abstraction.
| [reply] |
I don't know much about PostgreSQL, but I'd start with DBI and DBD::Pg.
Michael
| [reply] |