Re: Notiffy problem - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Notiffy problem
Date
Msg-id CAHyXU0yqU=QxFhkBSMcNgytjwsorUA2bA-ANh_DPvEo3+pzcKQ@mail.gmail.com
Whole thread Raw
In response to Re: Notiffy problem  (Richard Huxton <dev@archonet.com>)
Responses Re: Notiffy problem
List pgsql-general
On Fri, Jun 29, 2012 at 3:29 AM, Richard Huxton <dev@archonet.com> wrote:
> On 29/06/12 09:01, adasko98 wrote:
>>
>> Hi
>> In first sorry for my english :) I have got a problem with
>> notify/listener.
>> I do a function which returns a trigger. Everything is ok but when i want
>> send in a second parameter a variable NOTIFY say: "syntax error"
>
>
>>     Notify demoApp, 'some text';
>
>
>>        n_user :='sda';
>>     Notify demoApp, n_user ;<----here is a problem
>
>
> Looks like a limitation of the plpgsql parser, perhaps even counts as a bug.
> You can work around it with EXECUTE though, something like:
>  cmd := 'NOTIFY demoApp, ' || quote_literal(n_user);
>  EXECUTE cmd;
> or just
>  EXECUTE 'NOTIFY demoApp, ' || quote_literal(n_user);

also see pg_notify() function.

merlin

pgsql-general by date:

Previous
From: Atri Sharma
Date:
Subject: Re: Regarding parallel running of 9.1 and 9.2beta2
Next
From: adasko98
Date:
Subject: Re: Notiffy problem