Re: cannot get error message after dblink_exec execution - Mailing list pgsql-admin

From Joe Conway
Subject Re: cannot get error message after dblink_exec execution
Date
Msg-id 46C874C6.30603@joeconway.com
Whole thread Raw
In response to cannot get error message after dblink_exec execution  ("Sofer, Yuval" <Yuval_Sofer@bmc.com>)
List pgsql-admin
Sofer, Yuval wrote:
>           last_message := dblink_error_message('dbname=postgres
> user=postgres password=manager') ;


> Am I not using dblink_error_message correctly?

Yes, you are not using dblink_error_message correctly. From the docs:

==================================================================
Name

dblink_error_message -- gets last error message on the named connection

Synopsis

dblink_error_message(text connname) RETURNS text

Inputs

   connname
     The specific connection name to use.

Outputs

   Returns last error message.

Example usage

   SELECT dblink_error_message('dtest1');
==================================================================

It requires a named connection, you are trying to use an anonymous one.

HTH,

Joe

pgsql-admin by date:

Previous
From: "Sofer, Yuval"
Date:
Subject: cannot get error message after dblink_exec execution
Next
From: Dimitri Fontaine
Date:
Subject: Re: Yet Another Socket .s.PGSQL.5432 Problem