[SQL] Connection Oracle database from Postgres function
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.
[SQL] How to Log SELECT Statements Having Errors
We are putting a new application on PostgreSQL 8.0.1 (Windows 2003); we are coming off of MySQL, and are having a hard time finding all of the offending SQL calls. It would help a great deal if I could log the content of any SQL calls that fail. Am only interested in SELECT statements. Noticed the following: (1) The PostgreSQL manual says that config parm 'log_statement' does not appear to handle SELECT statements; true? (2) Noticed that config parm 'log_min_error_statement' might do it, but not sure what each of the DEBUG* and other parameters will buy me vs ERROR. I want any statement issued by a client that cannot be executed due to an SQL error of any kind. Can someone advise on this ? ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match