Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Perl, Postgres and Windows

by rhj4 (Initiate)
on Jan 18, 2011 at 00:44 UTC ( #882784=perlquestion: print w/replies, xml ) Need Help??
rhj4 has asked for the wisdom of the Perl Monks concerning the following question:

I am a C#/SQL Server programmer tasked with converting an ancient Perl/Posgtres website into C#. I have been programming for many years and in many languages, but never in Perl and I am having some challenges getting started.

I have downloaded and installed Postgresql 9.0 on my desktop and populated it with data from the production site which is on a machine that could die any day. I have written some test code in C# using Npgsql that successfully accesses data in that database, but I have encountered problems using PGAdmin III and psql. Both appear flakey or improperly configured (highly likely).

I have installed ActiveState 6.0.3 and Strawberry Perl and I am attempting to get started, but hit a wall quickly. The code below fails on the “use Pg;” line. I have located several versions of this file, but none that seems to meet the approval of the compiler. I think the problem involves four variables:

  • Version of ActiveState Komodo product (6.0.3)
  • Version of Perl compiler (perl 5, version 12, subversion 2 (V5.12.2) built for MSWin32-x64-multi-thread, according to command line “perl –v”)
  • Version of Postgresql (9.0)
  • Version of ???

Can you tell me what version of Pg I should install and where to put it in the code base?

require "PAQ.cfg";
require "";
use CGI qw(:standard);

$q = new CGI;

Replies are listed 'Best First'.
Re: Perl, Postgres and Windows
by syphilis (Chancellor) on Jan 18, 2011 at 01:12 UTC
    You don't mention what perl version you have, but the following are available via ppm for perl-5.12, either from the ActiveState repo, or the trouchelle repo (or, in some cases, both):

    DBD::PgPP, Pg::CLI, Pg::Explain, Pg::Loader, Pg::Priv.

    I don't know anything about Postgres, but I would think that it's the first in that list that gives you the driver you need. So, start with:
    ppm install DBD-PgPP
    and then 'ppm install' the others if they might also be useful.

Re: Perl, Postgres and Windows
by stefbv (Deacon) on Jan 18, 2011 at 10:17 UTC

    DBD::PgPP is the "Pure Perl" PostgreSQL driver, to be used when is no other choice, better use DBD::Pg, which is installed by default in ActiveState Perl 5.12.2 build 1203, and in Strawberry Perl.

    Regards, Stefan

Re: Perl, Postgres and Windows
by Limbic~Region (Chancellor) on Jan 18, 2011 at 16:35 UTC
    I have successfully used Pg and PGAdmin on various different windows for a couple of years without issue. I also have never used Pg - it was last updated 11 years ago. I don't know what issue you are having with PGAdmin but I am quite sure your issue with your code are that you are not using DBD::Pg. I don't want to knock C# but my guess is that if the project had been kept up to date, it would probably not be necessary to migrate now.

    Cheers - L~R

      Original developer could not keep up with code. He died. Company sold, and years later, I inherit the problem. I am still facing newbie-itis with perl. I have no difficulty with strongly typed languages, but others like perl and JavaScript give me headaches. The issue with PGAdmin III is that when I click the SQL button, the program locks up tight. No way out. Have to kill it and restart. Gives me lots of confidence in the code...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://882784]
Approved by ikegami
[Eily]: and since his name is a modified version of astérisque (asterisk), which is a typographical symbol, I think it's even funnier that he would lose a diacritic
[Eily]: the pun doesn't work so well with "he lost a diacritic" though :P
[LanX]: Obelix might offer to find it again ...
[LanX]: not much to translate anyway since Goscinny died
[Eily]: https://en. wiki/List_of_Aster ix_characters some of the names were changed to include a new pun
[LanX]: sure some are even funnier now
[LanX]: some lost because they were not translated like Epidemais
[LanX]: some of the english names are funny too

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2017-05-24 15:02 GMT
Find Nodes?
    Voting Booth?