Connection Oracle database from Postgres function - Mailing list pgsql-sql

From Dinesh Pandey
Subject Connection Oracle database from Postgres function
Date
Msg-id 20051114111340.9D5C7F0CF9@svr2.postgresql.org
Whole thread Raw
List pgsql-sql

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.

pgsql-sql by date:

Previous
From: "Bath, David"
Date:
Subject: selective dump pg_dump: only specific non-tables? with schema name?
Next
From: "Lane Van Ingen"
Date:
Subject: How to Log SELECT Statements Having Errors