Re: Notiffy problem

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: adasko98 <adasko(dot)86(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Notiffy problem
Date: 2012-06-29 14:53:33
Message-ID: CAHyXU0zPRqMHu9ph0pY-6VCmf8Bz2hZ4+R=92uC7v-VhiH2g6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jun 29, 2012 at 8:58 AM, adasko98 <adasko(dot)86(at)gmail(dot)com> wrote:
>
> On Fri, Jun 29, 2012 at 3:29 AM, Richard Huxton <dev(at)archonet(dot)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.
>
> Yes i'm looking for that. But i connect c# application with postgres and
> pg_notify() don't work with my notify event. Anyway thanks for help

huh? pg_notify() is just an alternate way of sending notifications.
it should be available from any client stack that allows calling
custom backend functions(including C#).

postgres=# listen test;
LISTEN
postgres=# select pg_notify('test', 'hello!');
pg_notify
-----------

(1 row)

Asynchronous notification "test" with payload "hello!" received from
server process with PID 31740.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-06-29 15:10:15 Re: Notiffy problem
Previous Message Kevin Grittner 2012-06-29 14:13:12 Re: Postgresql 9.0.6 alway run VACUUM ANALYZE pg_catalog.pg_attribute