Обсуждение: server closed unexpectedly while executing a function
Hi
I'm running a function in perl and it says
-----------------------------------------------------------------------------------------------------------------------------------
NOTICE: DBD::Pg::st execute failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
CONTEXT: SQL statement "SELECT sp_email( $1 , $2 )"
PL/pgSQL function "func_trg_email" line 2 at perform
NOTICE: DBD::Pg::st execute failed: no connection to the server
---------------------------------------------------------------------------------------------------------------------
how can i get more verbose messages that would tell me where exactly I'm going wrong.
I'm calling function sp_email from a trigger function func_trg_email here.
Thanks,
jas
I'm running a function in perl and it says
-----------------------------------------------------------------------------------------------------------------------------------
NOTICE: DBD::Pg::st execute failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
CONTEXT: SQL statement "SELECT sp_email( $1 , $2 )"
PL/pgSQL function "func_trg_email" line 2 at perform
NOTICE: DBD::Pg::st execute failed: no connection to the server
---------------------------------------------------------------------------------------------------------------------
how can i get more verbose messages that would tell me where exactly I'm going wrong.
I'm calling function sp_email from a trigger function func_trg_email here.
Thanks,
jas
To add to my last post,
in my perl function I'm using
use DBI;
my $dbh=DBI->connect("dbi:Pg:dbname=xyz; host=192.168.0.120; port=5432;", "", "");
to connect to the same DB server.
And then i have series of
dbh->prepare and ->execute
Unofrtunately it has started crying smth like
no connection to the server where ever i have these execute statements.
I just executes the first sql statement and fails at the rest
Jas
in my perl function I'm using
use DBI;
my $dbh=DBI->connect("dbi:Pg:dbname=xyz; host=192.168.0.120; port=5432;", "", "");
to connect to the same DB server.
And then i have series of
dbh->prepare and ->execute
Unofrtunately it has started crying smth like
no connection to the server where ever i have these execute statements.
I just executes the first sql statement and fails at the rest
Jas
On 2/23/07, Jasbinder Singh Bali <jsbali@gmail.com > wrote:
Hi
I'm running a function in perl and it says
-----------------------------------------------------------------------------------------------------------------------------------
NOTICE: DBD::Pg::st execute failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
CONTEXT: SQL statement "SELECT sp_email( $1 , $2 )"
PL/pgSQL function "func_trg_email" line 2 at perform
NOTICE: DBD::Pg::st execute failed: no connection to the server
---------------------------------------------------------------------------------------------------------------------
how can i get more verbose messages that would tell me where exactly I'm going wrong.
I'm calling function sp_email from a trigger function func_trg_email here.
Thanks,
jas
On Fri, Feb 23, 2007 at 09:34:51AM -0500, Jasbinder Singh Bali wrote: > To add to my last post, > in my perl function I'm using > > use DBI; > my $dbh=DBI->connect("dbi:Pg:dbname=xyz; host=192.168.0.120; port=5432;", > "", ""); > > to connect to the same DB server. > > And then i have series of > dbh->prepare and ->execute > Unofrtunately it has started crying smth like > > no connection to the server where ever i have these execute statements. > I just executes the first sql statement and fails at the rest Do the database logs of the server you're connecting to show what might be wrong? Have you used any of DBI's tracing options (see TRACING in the DBI manual page)? Does a standalone Perl script fail the same way? I'd suggest making sure the code works in a standalone script before using it in a trigger function. -- Michael Fuhr