Thread: Perl with Postrges under Cygwin

Perl with Postrges under Cygwin

From
"Jim.George"
Date:
Hi folks,
    I'm new to the list and need some help please.

      I've been happily using Spamassassin for several months under
  Cygwin (Linux under Win2K), and previously under Linux itself.  So with
  this confidence in the package I thought I'd improve things by linking in
  the database option.

      That's where my problem starts.  I went to CPAN to find a DBI and
  DBD for Postgres (had to grab the ODBC DBD as there wasn't one for
  Postgres), trouble is that the install of the DBI pgsql relies on dynamic
  libraries so I was hoping there was a binary port of these modules or
  advice on installation?

    Sorry I forgot to mention the most important part and that is that
the files libpq.so and libpq-fe.h do not appear to be present under my Cygwin
installation .

    The next thing I tried was the perl DBI module Postgres-1.4, however
when compiling this I got the following errors.


gcc -c -I/usr/local/postgres95/include -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -I/usr/local/include -DUSEIMPORTLIB
-O2  -DVERSION=\"1.4\" -DXS_VERSION=\"1.4\"  -I/usr/lib/perl5/5.6.1/cygwin-multi/CORE  Postgres.c 
Postgres.xs: In function `XS_PGconnPtr_getline':
Postgres.xs:148: `sv_undef' undeclared (first use in this function)
Postgres.xs:148: (Each undeclared identifier is reported only once
Postgres.xs:148: for each function it appears in.)
Postgres.xs: In function `XS_QUERYPtr_fetchrow':
Postgres.xs:339: `sv_undef' undeclared (first use in this function)
make: *** [Postgres.o] Error 1

    Can someone help me please to get Perl and Postgres working?

Thanks again,

Jim



Re: Perl with Postrges under Cygwin

From
"Gerrit P. Haase"
Date:
Hallo Jim.George,

Am Samstag, 15. Juni 2002 um 10:17 schriebst du:

>         That's where my problem starts.  I went to CPAN to find a DBI and
>   DBD for Postgres (had to grab the ODBC DBD as there wasn't one for
>   Postgres), trouble is that the install of the DBI pgsql relies on dynamic
>   libraries so I was hoping there was a binary port of these modules or
>   advice on installation?

DBD::Pg builds OOTB, with current DBI and Cygwin Perl versions.

>         Sorry I forgot to mention the most important part and that is that
> the files libpq.so and libpq-fe.h do not appear to be present under my Cygwin
> installation .

.so files are never there, just .dll libs.  If you have installed
postgres there are also the libs and headers.  Look in /lib or /bin
for the .dll's and in /usr/include/postgresql for the headers.

>         The next thing I tried was the perl DBI module Postgres-1.4, however
> when compiling this I got the following errors.

DBD-Pg?

> gcc -c -I/usr/local/postgres95/include -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -I/usr/local/include
-DUSEIMPORTLIB-O2   -DVERSION=\"1.4\" -DXS_VERSION=\"1.4\"  
> -I/usr/lib/perl5/5.6.1/cygwin-multi/CORE  Postgres.c
> Postgres.xs: In function `XS_PGconnPtr_getline':
> Postgres.xs:148: `sv_undef' undeclared (first use in this function)
> Postgres.xs:148: (Each undeclared identifier is reported only once
> Postgres.xs:148: for each function it appears in.)
> Postgres.xs: In function `XS_QUERYPtr_fetchrow':
> Postgres.xs:339: `sv_undef' undeclared (first use in this function)
> make: *** [Postgres.o] Error 1

>         Can someone help me please to get Perl and Postgres working?

What is the name of the module you are trying to compile?
Have you read the README in that package?


Gerrit
--
"All faults& bugs are mine - Robert"
    from squid/acinclude.m4,   Sun Apr 21 05:21:21 2002


Re: Perl with Postrges under Cygwin

From
Greg Matheson
Date:
On Sat, 15 Jun 2002, Jim.George wrote:

> .... I went to CPAN to find a DBI and DBD for Postgres (had to
> grab the ODBC DBD as there wasn't one for Postgres), trouble is
> that the install of the DBI pgsql relies on dynamic libraries
> ......

The DBD for Postgres is DBD::Pg.

--
Greg Matheson               Learn a third language and
Chinmin College             be born again, again.

Taiwan Penpals Archive <URL: http://netcity.hinet.net/kurage>

Re: Perl with Postrges under Cygwin

From
"Jim.George"
Date:
On Sat, 15 Jun 2002, Gerrit P. Haase wrote:

> Hallo Jim.George,
>
> Am Samstag, 15. Juni 2002 um 10:17 schriebst du:
>
> >         That's where my problem starts.  I went to CPAN to find a DBI and
> >   DBD for Postgres (had to grab the ODBC DBD as there wasn't one for
> >   Postgres), trouble is that the install of the DBI pgsql relies on dynamic
> >   libraries so I was hoping there was a binary port of these modules or
> >   advice on installation?
>
> DBD::Pg builds OOTB, with current DBI and Cygwin Perl versions.
>

I downloaded DBD::Pg but the README.win32 talks about Active-Perl, NT4, and
DBD-Pg-0.95, none of which I have.  I run Win2K, Perl 5.6.1 and haven't managed
to install DBD-Pg (nor any Perl/Postgres interface or driver).

The binary package, when un-tarred, creates a 'blib' sub-directory but I have
no idea where to put this.

Also my paths don't appear to match those of the README.win32.

<snip>

> .so files are never there, just .dll libs.  If you have installed
> postgres there are also the libs and headers.  Look in /lib or /bin
> for the .dll's and in /usr/include/postgresql for the headers.
>

the problem is I'm so turned around now on this I'm not sure where to start and
what directories are what.

Could you explain to me the packages I need (and dependencies) to be able to use
perl with postresql under cygwin?  I realise I'm virtually asking for things
to be handed to me on a plate but this is only to get to 1st base in another
project (SpamAssassin with a configurable white_list).


<snip>

>
> Gerrit
>


Re: Perl with Postrges under Cygwin

From
"Gerrit P. Haase"
Date:
Hallo Jim.George,

>> DBD::Pg builds OOTB, with current DBI and Cygwin Perl versions.

> I downloaded DBD::Pg but the README.win32 talks about Active-Perl, NT4, and

Huh?  We are talking about Cygwin.  No Win32 is involved here.

> <snip>
<snap>

> Could you explain to me the packages I need (and dependencies) to be able to use
> perl with postresql under cygwin?

Cygwin, Perl, PostgreSQL, GCC, binutils, make, and some more
buildtools like sed, bash,  much is already in the base
category if you've installed Cygwin with setup.exe.

Then, after having a running postgres DB you can install DBI and
DBD::Pg.

Just use the CPAN module:
Call on the command line:

$ cpan

And on the CPAN shell do (after init if neccessary):
1.
cpan> install DBI
2.
cpan> install DBD::Pg

Thats it.

If you got problems with the latest DBD::Pg version, post the
output of the single calls 'perl Makefile.PL' and 'make' of the
DBD::Pg build.


HTH,

Gerrit
--
"All faults& bugs are mine - Robert"
    from squid/acinclude.m4,   Sun Apr 21 05:21:21 2002


Re: Perl with Postrges under Cygwin

From
"Gerrit P. Haase"
Date:
Hallo Jim.George,

>> > <snip>
>> <snap>
> <snop>

:-)

>> Just use the CPAN module:
>> Call on the command line:

>> $ cpan
>>
>> And on the CPAN shell do (after init if neccessary):
>> 1.
>> cpan> install DBI

> Brilliant no problems at all.

>> 2.
>> cpan> install DBD::Pg
>>
> This failed due to the POSTGRESS_INCLUDE and POSTGRESS_LIB environment
> variables.  My problem is that I don't know what to set the variables
> to as they don't appear to agree with my directories.  Could you tell
> me what you believe they should be or could be?

$ set | grep POSTGRES_INCLUDE
POSTGRES_INCLUDE=/usr/include/postgresql

$ set | grep POSTGRES_LIB
POSTGRES_LIB=/usr/lib

>> Thats it.

> Well nearly ;)

>> If you got problems with the latest DBD::Pg version, post the
>> output of the single calls 'perl Makefile.PL' and 'make' of the
>> DBD::Pg build.

> See above...sorry

You're welcome,


Gerrit
--
"All faults& bugs are mine - Robert"
    from squid/acinclude.m4,   Sun Apr 21 05:21:21 2002


Re: Perl with Postrges under Cygwin

From
"Jim.George"
Date:
For completeness....This cured the problem.

Perl/Progress now working fine thanks to all, especially Gerrit, for help.

Jim


On Sun, 16 Jun 2002, Gerrit P. Haase wrote:

> Hallo Jim.George,
>
> >> > <snip>
> >> <snap>
> > <snop>
>
> :-)
>
> >> Just use the CPAN module:
> >> Call on the command line:
>
> >> $ cpan
> >>
> >> And on the CPAN shell do (after init if neccessary):
> >> 1.
> >> cpan> install DBI
>
> > Brilliant no problems at all.
>
> >> 2.
> >> cpan> install DBD::Pg
> >>
> > This failed due to the POSTGRESS_INCLUDE and POSTGRESS_LIB environment
> > variables.  My problem is that I don't know what to set the variables
> > to as they don't appear to agree with my directories.  Could you tell
> > me what you believe they should be or could be?
>
> $ set | grep POSTGRES_INCLUDE
> POSTGRES_INCLUDE=/usr/include/postgresql
>
> $ set | grep POSTGRES_LIB
> POSTGRES_LIB=/usr/lib
>
> >> Thats it.
>
> > Well nearly ;)
>
> >> If you got problems with the latest DBD::Pg version, post the
> >> output of the single calls 'perl Makefile.PL' and 'make' of the
> >> DBD::Pg build.
>
> > See above...sorry
>
> You're welcome,
>
>
> Gerrit
>