Re: dblink inside plpgsql function

From: Richard Huxton <dev(at)archonet(dot)com>
To: Loredana Curugiu <loredana(dot)curugiu(at)gmail(dot)com>
Cc: Bart Degryse <Bart(dot)Degryse(at)indicator(dot)be>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: dblink inside plpgsql function
Date: 2007-07-03 12:32:13
Message-ID: 468A41CD.2070208@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Loredana Curugiu 2007-07-03 12:50:18 Re: [SQL] dblink inside plpgsql function
Previous Message Loredana Curugiu 2007-07-03 12:25:51 Re: dblink inside plpgsql function

Browse pgsql-sql by date

  From Date Subject
Next Message Loredana Curugiu 2007-07-03 12:50:18 Re: [SQL] dblink inside plpgsql function
Previous Message Loredana Curugiu 2007-07-03 12:25:51 Re: dblink inside plpgsql function