Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 26D799FBBA4 for ; Tue, 3 Jul 2007 09:32:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 70650-02 for ; Tue, 3 Jul 2007 09:32:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 649879FBCD4 for ; Tue, 3 Jul 2007 09:32:14 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 46E6976349; Tue, 3 Jul 2007 13:32:13 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 27ABC2740EC; Tue, 3 Jul 2007 13:32:13 +0100 (BST) Message-ID: <468A41CD.2070208@archonet.com> Date: Tue, 03 Jul 2007 13:32:13 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Loredana Curugiu Cc: Bart Degryse , Pavel Stehule , pgsql-sql@postgresql.org Subject: Re: dblink inside plpgsql function References: <1c23c8e70707030202n323ee171n20f39cdece5b3618@mail.gmail.com> <162867790707030213h7c81e498p1b5f9d7c9cf1cc9b@mail.gmail.com> <468A36F0.A3DD.0030.0@indicator.be> <1c23c8e70707030525m59ee79d0r425813cd93131bbc@mail.gmail.com> In-Reply-To: <1c23c8e70707030525m59ee79d0r425813cd93131bbc@mail.gmail.com> 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: 200707/14 X-Sequence-Number: 28749 Loredana Curugiu wrote: > I created the following function > > CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF > reminder_services AS' > DECLARE r reminder_services%ROWTYPE; > BEGIN > SELECT dblink_connect(''dbname=''||$1); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > and I get the same errors. I think it is a problem with the dblink because > the following function it works fine if I call SELECT * FROM > getReminders(). You still haven't fixed the line above. The same rules apply to all SELECTs -- Richard Huxton Archonet Ltd