Skip site navigation (1) Skip section navigation (2)

RE: RE: RE: tourble migrating from linux/Apache/postgresql/perl to win2000/IIS/postgresql/perl

From: Rishi Sharma <rsharma(at)Bigstep(dot)net>
To: "'s0lao(at)netscape(dot)net '" <s0lao(at)netscape(dot)net>, Rishi Sharma <rsharma(at)Bigstep(dot)net>
Cc: "'Jason(dot)Tishler(at)dothill(dot)com '" <Jason(dot)Tishler(at)dothill(dot)com>, "'pgsql-cygwin(at)postgresql(dot)org '" <pgsql-cygwin(at)postgresql(dot)org>
Subject: RE: RE: RE: tourble migrating from linux/Apache/postgresql/perl to win2000/IIS/postgresql/perl
Date: 2001-06-14 04:16:38
Message-ID: (view raw or flat)
Lists: pgsql-cygwin
Dear Slao,

Thanks for the explanation.

I figured out what was casuing my make to fail.
Solution: move the cygwin/bin before winnt;winnt/system32 in the PATH
variable.  I recommend adding a note at the bottom of

I was able to build the postgres7.1.2-1 source and also build the
module (thanks Slao).  Evertyhing works in a windows shell...I can run my
simple test script and query the database properly:

test script:
#use Pg;
#$conn = Pg::connectdb("dbname=intake");
#if ($status != PGRES_CONNECTION_OK) {
#    print STDERR "fatal error ($status), terminated\n";
#    exit (1);
#    Pg::doQuery($conn, " select * from tbl_checklist", \(at)arreglo);
#    foreach my $i (0 .. $#arreglo) {
#        foreach my $j (0 .. $#{$arreglo[$i]}) {
#            print "$arreglo[$i][$j]\t";
#        }
#        print "\n";
#    }
#exit (0);

result from test in shell:
200005100000    121
200005100000    122
200005100000    123
200005100000    124
200005100000    128
200005100000    129
200005100000    130
200005100000    131
200005100000    132
200005100000    133
200005100000    134


Now I need to figure out how to do this in a CGI ... my cgi seems to be
hanging again where I say "use Pg;".  The browser just waits there until the
cgi times out.  I don't think Pg is being loaded properly.

here is the CGI:
use Pg;
use CGI qw(:standard);

print header;
print start_html('A PostgresSQL Example'),
      h1('A PostgresSQL Examplee2'),
      "SQL: select * from tbl_checklist",

#$conn = Pg::connectdb("dbname=intake");
$conn = Pg::new('','','','','intake');

if ($status != PGRES_CONNECTION_OK) {
    print STDERR "Error fatal en la conexion ($status), terminamos\n";
    exit (1);

$sql = "select * from tbl_checklist";
$result = $conn->exec($sql);

$t = '1';
$html3 = $t;
$align = $t;
$header = $t;
$tableOpt = 'Border';

$result->print(stdout, $header, $align, $standard, $html3, $expanded,
               $pager, $fieldSep, $tableOpt, $caption);

print end_html;


-----Original Message-----
From: s0lao(at)netscape(dot)net
To: rsharma(at)bigstep(dot)net
Cc: s0lao(at)netscape(dot)net; Jason(dot)Tishler(at)dothill(dot)com;
Sent: 6/11/01 10:29 PM
Subject: Re: RE: [CYGWIN] RE: tourble migrating from
linux/Apache/postgresql/perl to win2000/IIS/postgresql/perl

Rishi Sharma <rsharma(at)Bigstep(dot)net> wrote:
> SLao,
> Let me try to clarify...the perl scripts try to load the module
> stating "use Pg".  You say this should be a binary file?  I found a
> copies of under .../perl/src or something like that, but it was
> text, I didn't dig too deep in to what it was doing.

Ok, then it's clear your scripts are using the Pg driver bundled with

> I've found this from
> symbolstone
> hopefully it's all I need.

From the point the above affirmation was made, any reference to DBI/DBD
drivers becomes redundant. If your scripts use the Pg driver, migrating
to DBI/DBD::Pg driver could be difficult, as they should be (quite some
more than) batch changed.

> If I install postgresql-7.1.2 from Jason and drop in the libpq.dll and
> Pg.dll in my winnt/system32 should I be able to access my database
from cgi
> scripts with simply stating "use Pg"??
> There seems to be something missing here...

Maybe yet another comment :) You must not forget to place
somewhere so that Perl is able to find it. I think the layout with
libpq.dll and pg.dll in winnt/system32 is viable. But, anyway, for any
eventual problems, here's what "make install" in "src/interfaces/perl"

$ ls -lR /usr/local/lib/perl5/site_perl/5.6.0/cygwin/
total 9
-r--r--r--   1 lao      544         18124 Sep 27  1998
drwxr-xr-x   3 lao      544             0 Jun 11 08:57 auto

total 0
drwxr-xr-x   2 lao      544             0 Jun 11 08:57 Pg

total 83
-r--r--r--   1 lao      544             0 Jun 11 08:57
-r-xr-xr-x   1 lao      544         73728 Jun 11 08:57 Pg.dll
-r--r--r--   1 lao      544            81 Jun 11 08:57 autosplit.ix
-r--r--r--   1 lao      544         93106 Jun 11 08:57 libPg.a

I think that a link to winnt/system32/Pg.dll in
/usr/local/lib/perl5/site_perl/5.6.0/cygwin/auto/Pg could solve any
(eventual) Perl instalation issues.

Good luck!

Get your own FREE, personal Netscape Webmail account today at

pgsql-cygwin by date

Next:From: Rishi SharmaDate: 2001-06-14 04:45:07
Subject: RE: RE: RE: tourble migrating from linux/Apache/postgresql/perl to win2000/IIS/postgresql/perl
Previous:From: Jason TishlerDate: 2001-06-13 14:58:56
Subject: Re: Help

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group