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

Hi,
I can't seem to make the DBD::Pg Postgres driver to work on ActiveState Perl 5.8.8.817 w/ Win2k
I'm using Perl at work and I can't change much of the environment: I have to make do with a Windows 2000 professional (yes, that's a pretty old OS ... but I have nothing else).
I have installed (a couple of years ago) ActiveState Perl 5.8.8.817 and I am generally satisfied with it but I can upgrade this if required.
I can't access ActiveState package repository via ppm though (firewall settings I don't control). And I can't build from C / C++ sources, so I've downloaded DBI 1.59 as well as DBD::Pg as ActiveState packages from uwinnipeg.ca and installed them both from a local (hard drive) repository using ppm.
DBI seems to be working, I can list available drivers (it lists the Postgresql driver), but when I try to do a DBI->connect my perl script causes an address violation and crashes.

Thanks for your suggestions
Sorin
  • Comment on DBD-Pg.dll crashes on Win2K w/ ActiveState 5.8

Replies are listed 'Best First'.
Re: DBD-Pg.dll crashes on Win2K w/ ActiveState 5.8
by roboticus (Chancellor) on May 05, 2010 at 13:15 UTC
      Hi roboticus,

      Thanks for trying to answer. I was actually hoping someone has direct relevant experience with settings that approach mine (DBD-Pg.dll on Win2k with ActiveState Perl).

      There are NO error details to provide, as can be inferred from my message : perl.exe crashes, I get a windows box with a useless message "Address violation at 0x534721789 : the memory cannot be read" (or something like that).

      The "ideal answer" I was hoping for went along the lines "I use DBI + DBD-Pg.dll without problems on Win2K with ActiveState 5.10 (or 5.12)" - then I could upgrade my perl installation and try again.

      The "anti-ideal answer" would have been "I use DBI + DBD-Pg.dll without problems with ActiveState 5.8.8 on Win XP. Tried it on Win 2K and it caused perl to crash as well." - then I would know there is no solution for me since I can't change the OS ...
Re: DBD-Pg.dll crashes on Win2K w/ ActiveState 5.8
by BrowserUk (Pope) on May 05, 2010 at 14:01 UTC

    Try DBD::PgPP. (PP means pure perl. No compiler needed.)

    There's only one file to install PgPP.pm, and that only needs to be copied into the right place in your perl installation.

    But it is only a stop gap. In the long term, you need to sort out your perl environment.

Re: DBD-Pg.dll crashes on Win2K w/ ActiveState 5.8
by Limbic~Region (Chancellor) on May 06, 2010 at 00:18 UTC
      Thanks for your suggestions.
      However, I have no need to make this work at home. It would be helpful if I could make it work at the office, where unfortunately I can't change the OS (it's Win 2K and there's nothing I can do about it) and I can't freely access the web either (I can do some downloads but not everything). The post you pointed me to encounters an "upstream" problem (compared to mine) : the driver cannot be located. In my case, the driver is located and loaded but it looks like there's some incompatibility between the various libraries since perl.exe crashes

      Regards,
      Sorin
Re: DBD-Pg.dll crashes on Win2K w/ ActiveState 5.8
by erix (Prior) on May 06, 2010 at 14:37 UTC
      Ok, problem solved, thanks to all who replied
      The answer is : it doesn't work with ActiveState 5.8.8.817, but it works with ActiveState 5.8.9.827.
        rearranging the .ppd should be like a red herring
      There was some progress ...
      Went to pgFoundry and downloaded the files under DBD-Pg-2.10.0-Perl5.8 : the .ppd and the .tar.gz
      I think they were never really tested with Perl5.8 :
      - the .ppd did not work, I had to re-arrange it (removing the <DEPENDENCY name="version" ...> line)

      - the package itself did not work either, got at first crashes in Pg.pm because it stated 'use version;' and 'our version = qv(...' and neither are valid in perl 5.8
      - after I took these out (not really needed) I got the "install_driver(Pg) failed : Can't load '...Pg.dll' for module DBD::Pg ..." error. After searching for wisdom on this error I found a solution : place all PostgreSQL dlls in the PATH. This indicates to me that the PostgreSQL dlls should be bundled with the DBD::Pg package because I want to run the perl script on a machine that does NOT have PostgreSQL installed but instead connects to a remote DB.
      Anyway, after copying the relevant DLLs fron the PostgreSQL machine to the one where I want my perl script to run, I relaunched and ... (here it becomes interesting) ... it exploded with a Windows error msgbox saying :

      "The procedure entry point Perl_sv_2iv_flags could not be located in the dynamic link library perl58.dll"