Re: dbi-link with Sybase - Mailing list pgsql-general

From Albe Laurenz
Subject Re: dbi-link with Sybase
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203A89931@exadv11.host.magwien.gv.at
Whole thread Raw
In response to dbi-link with Sybase  (fernando@lozano.eti.br)
List pgsql-general
> This may not be the best list for my question, but I'm sure someone there will he able to help me

There's a mailing list dedicated to DBI-Link, see
http://lists.pgfoundry.org/mailman/listinfo/dbi-link-general

> I'm trying to use dbi-link under RHEL5.3. Using PostgreSQL and Perl rpms from distro, installed
> Sybase ASE 1.5.5 developers edition and DBD::Sybase using cpan -i.
>
> My test programs, using pubs2 example database, work fine. They connect as:
>
> $dbh = DBI->connect("dbi:Sybase:server=RHEL53I386", "teste", "123testando");
>
> So I have a working DBD::Sybase install. But then I try to initialize dbi-link using the statement:
>
> SELECT make_accessor_functions(
>     'dbi:Sybase:server=RHEL53I386',
>     'teste',
>     '123testando',
>     '---
> AutoCommit: 1
> RaiseError: 1
> ',
>     NULL,
>     NULL,
>     NULL,
>     'pubs2'
> );
>
> I get the error (from postgresql logs)
>
> OpenClient message: LAYER = (7) ORIGIN = (2) SEVERITY = (6) NUMBER = (6)
> Message String: ct_con_alloc(): unable to get layer message string: unable to ge
> t origin message string: error string not available
> NOTICE:  ct_con_alloc failed at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread
> -multi/DBD/Sybase.pm line 92.
>
> CONTEXT:  SQL statement "SELECT dbi_link.cache_connection( 1 )"
>         SQL statement "SELECT dbi_link.create_accessor_methods(
>             'pubs2',
>             NULL,
>             NULL,
>             'dbi:Sybase:server=RHEL53I386',
>             'teste',
>             '123testando',
>             1
>         )
>         "
> ERROR:  error from Perl function: error from Perl function: error from Perl func
> tion: DBI connect('server=RHEL53I386','teste',...) failed: (no error string) at
> line 137 at line 36. at line 53.
>
> I already tried forcing my database to en_US.UTF-8 and sourced SYBASE.sh from postgres bash_profile
> script. Before that, the error was aboit missing dynamic libs.
>
> I know this looks more a sybase thing than a postgresql thing but maybe someone can understand the
> sybase error message and help me. After all I hope someone out there does use dbi-link

Do you know what that Sybase error means?
If you know that, maybe you can figure out what's wrong...

Does the connection to Sybase depend on environment variables?
I have had a problem like this with Oracle and DBI-Link, environment
variables of the postmaster didn't make it into DBI-Link functions.
If that is your problem, you can use the fifth argument to make_accessor_methods to pass
(YAML encoded) environment settings.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Finding the bin path
Next
From: Jasen Betts
Date:
Subject: Re: Who writes "CONTEXT" ?