Обсуждение: Connection Oracle database from Postgres function

Поиск
Список
Период
Сортировка

Connection Oracle database from Postgres function

От
"Dinesh Pandey"
Дата:

I want to access Oracle database from Postgres. One way to use DBI-LINK and use “plperl” function in Postgres to make connection with Oracle. Using that I am getting the following error.

 

Environment

 

Solaris 9 SPARC

PostgreSQL 8.0

DBI-LINK

Perl-5.8.5

-------------------------------------------------------------------

My Function

 

CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $$

    if ($_[0] > $_[1]) { return $_[0]; }

    return $_[1];

$$ LANGUAGE plperl;

-------------------------------------------------------------------

On running this above function from sql prompt, I am getting this error, and connection with database lost

 

test=# select perl_max(1,2);

 

server closed the connection unexpectedly

        This probably means the server terminated abnormally

        before or while processing the request.

The connection to the server was lost. Attempting reset: Failed.