Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 135EB9F9C04 for ; Sun, 19 Aug 2007 13:50:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 90624-06 for ; Sun, 19 Aug 2007 13:50:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from joeconway.com (joeconway.com [68.15.9.201]) by postgresql.org (Postfix) with ESMTP id 331F49F9BF9 for ; Sun, 19 Aug 2007 13:50:15 -0300 (ADT) Received: from [192.168.4.40] (account jconway [192.168.4.40] verified) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 5312052; Sun, 19 Aug 2007 09:50:14 -0700 Message-ID: <46C874C6.30603@joeconway.com> Date: Sun, 19 Aug 2007 09:50:14 -0700 From: Joe Conway User-Agent: Thunderbird 1.5.0.12 (X11/20070719) MIME-Version: 1.0 To: "Sofer, Yuval" CC: pgsql-admin@postgresql.org, "Abraham, Danny" Subject: Re: cannot get error message after dblink_exec execution References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/216 X-Sequence-Number: 26547 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