Re: [BUGS] BUG #2517: Trouble with cx_Oracle and Plpython

From: David Fetter <david(at)fetter(dot)org>
To: Sergey Konoplev <konoplev(at)gw(dot)tander(dot)ru>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #2517: Trouble with cx_Oracle and Plpython
Date: 2006-07-06 21:24:59
Message-ID: 20060706212459.GA3215@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On Thu, Jul 06, 2006 at 08:27:53AM +0000, Sergey Konoplev wrote:
>
> The following bug has been logged online:
>
> Description: Trouble with cx_Oracle and Plpython
>
> CREATE OR REPLACE FUNCTION "public"."function1" () RETURNS varchar AS
> $body$
> import cx_Oracle
> connection = cx_Oracle.connect('xxx', 'xxx', 'xxx')
> $body$
> LANGUAGE 'plpythonu' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
>
> The function has executed successfully via psql interactive tool
> with local transport.

>
> pgdb:/ # /opt/PostgreSQL/bin/psql -U postgres -d transport
> Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
>
> Type: \copyright for distribution terms
> \h for help with SQL commands
> \? for help with psql commands
> \g or terminate with semicolon to execute query
> \q to quit
>
> transport=# select * from function1();
> function1
> -----------
>
> (1 row)
>
> transport=#
>
> But ORA-12154 error has been raised via same tool with remote transport.
>
> pgdb:/ # /opt/PostgreSQL/bin/psql -U postgres -d transport -h
> 192.168.101.181
> Password for user postgres:
> Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
>
> Type: \copyright for distribution terms
> \h for help with SQL commands
> \? for help with psql commands
> \g or terminate with semicolon to execute query
> \q to quit
>
> transport=# select * from function1();
> ERROR: plpython: function "function1" failed
> DETAIL: cx_Oracle.DatabaseError: ORA-12154: TNS:could not resolve the
> connect identifier specified

This means you need to fix your connect identifier for Oracle so that
it works both locally and remotely. It's a bug in your script, not in
PostgreSQL, so I'm moving this to -general :)

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jean Paul Aguilar Ruiz 2006-07-06 22:16:08 BUG #2520: security problem
Previous Message Yann PICHOT 2006-07-06 13:17:08 Re: Fwd: Diffrence between 8.0.3 and 8.1.3

Browse pgsql-general by date

  From Date Subject
Next Message Weerts, Jan 2006-07-06 21:36:11 duplicated values on primary key field on reindex
Previous Message Merlin Moncure 2006-07-06 20:56:31 Re: OLEDB connection does not want to work. Help!!