Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Running a script on Windows to access a postgres database on Linux

by TASdvlper (Monk)
on Mar 30, 2006 at 19:26 UTC ( [id://540253]=perlquestion: print w/replies, xml ) Need Help??

TASdvlper has asked for the wisdom of the Perl Monks concerning the following question:

All,

I was hoping this would be a easy job, but I'm a bit stuck now. Let me give you a little background on what I'm trying to accomplish.

Over the past few years I've written a web-based tool used for tracking test cases and results, it runs directly on Linux and there's a postgres db in the back end where everything is stored. I wrote a module specific for database transactions (queries, inserts, updates, etc).

Anyway, we have a automation team that are writing scripts that mostly run on Windows, I was hoping I could give them my Database module, and they would integrate it into their scripts and then they would have direct access to the database. Currently, they are writing their results out to a flat file, I thought if they could write to our database directly, it would be must more efficient and we would get results from the scripts in "real-time".

So, I write a little script on Windows, and included my db module (which I slightly modified). I installed ActivePerl 5.8 and installed the DBI module (using ppm).

But now it's complaining about a DBD::pg.pm module (see below).

install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (@INC contai +ns: C: ne 3. Perhaps the DBD::Pg perl module hasn't been fully installed, or perhaps the capitalisation of 'Pg' isn't right. Available drivers: DBM, ExampleP, File, PgPP, Proxy, Sponge. at DataBaseActions.pm line 43
I've looked in ppm, and searched on DBD and got the following:
ppm> search DBD Searching in Active Repositories 1. DBD-ADO [2.95] DBD-ADO 2. DBD-AnyData [0.08] DBD-AnyData 3. DBD-Chart [0.80] DBD-Chart 4. DBD-CSV [0.22] DBD-CSV 5. DBD-Excel [0.06] DBD-Excel 6. DBD-File [0.34] DBD-File 7. DBD-LDAP [0.07] DBD-LDAP 8. DBD-Log [0.21] DBD-Log 9. DBD-Mimer [1.00] DBD-Mimer 10. DBD-Mock [1.32] DBD-Mock 11. DBD-Multiplex [1.98-1] DBD-Multiplex 12. DBD-mysql [3.0002] DBD-mysql 13. DBD-mysql-SimpleMySQL [0.5] DBD-mysql-SimpleMySQL 14. DBD-mysqlPP [0.04] DBD-mysqlPP 15. DBD-ODBC [1.13] DBD-ODBC 16. DBD-Oracle [1.17] DBD-Oracle 17. DBD-Ovrimos [0.12] DBD-Ovrimos 18. DBD-PgPP [0.05] DBD-PgPP 19. DBD-Redbase [0.21] DBD-Redbase 20. DBD-Sprite [0.56] DBD-Sprite 21. DBD-SQLite [1.11] DBD-SQLite 22. DBD-SQLite2 [0.33] DBD-SQLite2 23. DBD-SQLrelay [0.1] DBD-SQLrelay 24. DBD-Template [0.01] DBD-Template 25. DBD-XBase [0.241] DBD-XBase 26. DBIx-AnyDBD [2.01] DBIx-AnyDBD 27. FabForce-DBDesigner4 [0.02] FabForce-DBDesigner4 ppm> install DBD-pgPP
So, at this point I'm not sure what else I can do ??? I don't see a DBD::pg.pm module. I did try to load the PgPP driver, but that didn't help.

If anybody has any ideas I would greatly appreciate it.

UPDATE:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ok, I've installed the DBD::PgPP driver and I'm trying to run my script, and I'm getting the following error:

DBD::PgPP::db selectall_arrayref failed: Unknown message type: ' at DataBaseActions.pm line 124.

I know my code is ok because it's the same code that runs on Linux. Any thoughts ?

Replies are listed 'Best First'.
Re: Running a script on Windows to access a postgres database on Linux
by zer (Deacon) on Mar 30, 2006 at 19:47 UTC
    DBD::PgPP is what you need. As CPAN Says "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. How nifty!"

    Since PostgreSQL doesnt appear to be ported, this should be the solution

Re: Running a script on Windows to access a postgres database on Linux
by john_oshea (Priest) on Mar 31, 2006 at 10:08 UTC

    You should be able to install DBD::Pg directly using the wonderful CamelPack installer, which can compile XS modules directly on Win32. From what I recall of the DBD::Pg install process, you'll need to have access to an instance of PostgreSQL on the machine as well, as I seem to recall it asks for the path to pg_config or something.

    Hope that helps.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://540253]
Approved by Tanktalus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found