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

BUG #2517: Trouble with cx_Oracle and Plpython

From: "Sergey Konoplev" <konoplev(at)gw(dot)tander(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2517: Trouble with cx_Oracle and Plpython
Date: 2006-07-06 08:27:53
Message-ID: 200607060827.k668RrgO033304@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-general
The following bug has been logged online:

Bug reference:      2517
Logged by:          Sergey Konoplev
Email address:      konoplev(at)gw(dot)tander(dot)ru
PostgreSQL version: 8.1.4
Operating system:   SUSE LINUX Enterprise Server 9
Description:        Trouble with cx_Oracle and Plpython
Details: 

Good day.

Ive got a trouble with cx_Oracle and Plpython (PostgreSQL).

The function DDL:

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

transport=#

How can I solve this problem? 

Regards,
Konoplev Sergey <konoplev(at)gw(dot)tander(dot)ru>
Sen. software dveloper, IT department
Tander JSC
-------------------------------------------------
Levanevskogo st. 185, Krasnodar city, RUSSIA
Phone +7 861 210-98-10 (add.233) 
Icq 29353802

Responses

pgsql-bugs by date

Next:From: Yann PICHOTDate: 2006-07-06 13:17:08
Subject: Re: Fwd: Diffrence between 8.0.3 and 8.1.3
Previous:From: Sam HowardDate: 2006-07-06 05:32:12
Subject: BUG #2516: group privs do not seem to be honored

pgsql-general by date

Next:From: Marco BizzarriDate: 2006-07-06 09:31:48
Subject: Re: Dumping in LATIN1 and restoring in UTF-8
Previous:From: Tino WildenhainDate: 2006-07-06 07:58:06
Subject: Re: Dumping in LATIN1 and restoring in UTF-8

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