Обсуждение: RAISE NOTICE

Поиск
Список
Период
Сортировка

RAISE NOTICE

От
"Luigi N. Puleio"
Дата:
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="font: inherit;" valign="top">Hello everyone...<br
/><br/>I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE can't be shown on windows with a
popupmessage like the EXCEPTION, indeed it goes to log messages list..<br />So, is there any way to show a popup
messagewith a custom textmessage on it from a PL/PgSQL function?...<br /><br />Thanks to all in advance,<br />Ciao<br
/>Luigi<br/></td></tr></table><br /> 

Re: RAISE NOTICE

От
Gerardo Herzig
Дата:
Luigi N. Puleio wrote:
> Hello everyone...
> 
> I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE can't be shown on windows with a popup
messagelike the EXCEPTION, indeed it goes to log messages list..
 
> So, is there any way to show a popup message with a custom textmessage on it from a PL/PgSQL function?...
> 
> Thanks to all in advance,
> Ciao
> Luigi
> 
> 
> 
>       
That looks like a sql-client (pgAdmin, pgAccess,?) implementation
feature, isnt?

Gerardo


Re: RAISE NOTICE

От
"Luigi N. Puleio"
Дата:
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="font: inherit;" valign="top">Sort of....the message
shouldcome along a standalone application too when with an ADO component I do a Post() which calls the function...just
thematter is I can't modify the application to manage a possibly notification...only the postgresql's function...<br
/>That'swhy I'm asking about a possibility to get a notification from the function like it's an EXCEPTION...<br /><br
/>---On <b>Fri, 5/8/09, Gerardo Herzig <i><gherzig@fmed.uba.ar></i></b> wrote:<br /><blockquote
style="border-left:2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br />From: Gerardo Herzig
<gherzig@fmed.uba.ar><br/>Subject: Re: [SQL] RAISE NOTICE<br />To: "Luigi N. Puleio"
<npuleio@rocketmail.com><br/>Cc: pgsql-sql@postgresql.org<br />Date: Friday, May 8, 2009, 11:34 AM<br /><br
/><divclass="plainMail">Luigi N. Puleio wrote:<br />> Hello everyone...<br />> <br />> I have a PL/PgSQL
functionwhere I use RAISE NOTICE but this kind of RAISE can't be shown on windows with a popup message like the
EXCEPTION,indeed it goes to log messages list..<br />> So, is there any way to show a popup message with a custom
textmessageon it from a PL/PgSQL function?...<br />> <br />> Thanks to all in advance,<br />> Ciao<br />>
Luigi<br/>> <br />> <br />> <br />>       <br />That looks like a sql-client (pgAdmin, pgAccess,?)
implementation<br/>feature, isnt?<br /><br />Gerardo<br /><br />-- <br />Sent via pgsql-sql mailing list (<a
href="/mc/compose?to=pgsql-sql@postgresql.org"
ymailto="mailto:pgsql-sql@postgresql.org">pgsql-sql@postgresql.org</a>)<br/>To make changes to your subscription:<br
/><ahref="http://www.postgresql.org/mailpref/pgsql-sql"
target="_blank">http://www.postgresql.org/mailpref/pgsql-sql</a><br/></div></blockquote></td></tr></table><br /> 

Re: RAISE NOTICE

От
"Milen A. Radev"
Дата:
Luigi N. Puleio написа:
> Sort of....the message should come along a standalone application too when with an ADO component I do a Post() which
callsthe function...just the matter is I can't modify the application to manage a possibly notification...only the
postgresql'sfunction...
 
> That's why I'm asking about a possibility to get a notification from the function like it's an EXCEPTION...
[...]

I believe the fine manual is clear about this
(http://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html):

"Whether messages of a particular priority are reported to the client,
written to the server log, or both is controlled by the log_min_messages
and client_min_messages configuration variables. See Chapter 18 for more
information."


-- 
Milen A. Radev



Re: RAISE NOTICE

От
"Luigi N. Puleio"
Дата:
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="font: inherit;" valign="top">The fact is I have in my
postgresql.conf this:<br /><br />client_min_messages = notice<br /><br />but if I call the function which has RAISE
NOTICEit doesn't return a notice to the clienti...indeed I see it in the logfile on server status... <br /><br />that's
whyI was asking if there is a way...  maybe I could also have written wrong config for that parameter... <br /><br
/>---On <b>Fri, 5/8/09, Milen A. Radev <i><milen@radev.net></i></b> wrote:<br /><blockquote style="border-left:
2pxsolid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br />From: Milen A. Radev <milen@radev.net><br
/>Subject:Re: [SQL] RAISE NOTICE<br />To: pgsql-sql@postgresql.org<br />Date: Friday, May 8, 2009, 11:52 AM<br /><br
/><divclass="plainMail">Luigi N. Puleio написа:<br />> Sort of....the message should come along a standalone
applicationtoo when with an ADO component I do a Post() which calls the function...just the matter is I can't modify
theapplication to manage a possibly notification...only the postgresql's function...<br />> That's why I'm asking
abouta possibility to get a notification from the function like it's an EXCEPTION...<br />[...]<br /><br />I believe
thefine manual is clear about this<br />(<a
href="http://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html"
target="_blank">http://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html</a>):<br/><br />"Whether
messagesof a particular priority are reported to the client,<br />written to the server log, or both is controlled by
thelog_min_messages<br />and client_min_messages configuration variables. See Chapter 18 for more<br />information."<br
/><br/><br />-- <br />Milen A. Radev<br /><br /><br />-- <br />Sent via pgsql-sql mailing list (<a
href="/mc/compose?to=pgsql-sql@postgresql.org"
ymailto="mailto:pgsql-sql@postgresql.org">pgsql-sql@postgresql.org</a>)<br/>To make changes to your subscription:<br
/><ahref="http://www.postgresql.org/mailpref/pgsql-sql"
target="_blank">http://www.postgresql.org/mailpref/pgsql-sql</a><br/></div></blockquote></td></tr></table><br /> 

Re: RAISE NOTICE

От
Gerardo Herzig
Дата:
Luigi N. Puleio wrote:

> --- On Fri, 5/8/09, Gerardo Herzig <gherzig@fmed.uba.ar> wrote:
> 
> From: Gerardo Herzig <gherzig@fmed.uba.ar>
> Subject: Re: [SQL] RAISE NOTICE
> To: "Luigi N. Puleio" <npuleio@rocketmail.com>
> Cc: pgsql-sql@postgresql.org
> Date: Friday, May 8, 2009, 11:34 AM
> 
> Luigi N. Puleio wrote:
>> Hello everyone...
>>
>> I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE can't be shown on windows with a popup
messagelike the EXCEPTION, indeed it goes to log messages list..
 
>> So, is there any way to show a popup message with a custom textmessage on it from a PL/PgSQL function?...
>>
>> Thanks to all in advance,
>> Ciao
>> Luigi
>>
>>
>>
>>        
> That looks like a sql-client (pgAdmin, pgAccess,?) implementation
> feature, isnt?
> 
> Gerardo
> 
> Sort of....the message should come along a standalone application too
when with an ADO component I do a Post() which calls the function...just
the matter is I can't modify the application to manage a possibly
notification...only the postgresql's function...
> That's why I'm asking about a possibility to get a notification from
the function like it's an EXCEPTION...
>

Well, in that case, the ADO component is the client. This is the place
to modify de code, to capture the NOTICE. Im shure the ADO (or any other
component who actually connect to the database and makes the query) has
the ability to react when an EXCEPTION is thrown. My guess is that
EXCEPTION's goes trough StandardError, but NOTICE's goes trough
StandardOutput, and that could be some idea why your app is not getting
notice about NOTICES :)

I will wait for some expert dude to respond this, because im going
myself into unknown territory.

Gerardo



Re: RAISE NOTICE

От
Jasen Betts
Дата:
On 2009-05-08, Luigi N. Puleio <npuleio@rocketmail.com> wrote:
>
> --0-1541576050-1241773508=:80512
> Content-Type: text/plain; charset=us-ascii
>
> Hello everyone...
>
> I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE can't be shown on windows with a popup
messagelike the EXCEPTION, indeed it goes to log messages list..
 
> So, is there any way to show a popup message with a custom textmessage on it from a PL/PgSQL function?...

postgres doesn't produce popups (your application does that)

To get notification you need to call PQsetNoticeProcessor() to register a callback function.


Re: RAISE NOTICE

От
"Luigi N. Puleio"
Дата:
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="font: inherit;" valign="top">Hello Jasen,<br /><br
/>doyou know if PQsetNoticeProcessor() is appliable to ADOQuery->Post()?<br /><br />I mean if I have an event where
there'sADOQuery->Post(), should I do something like:<br /><br />returnvalue = ADOQuery->Post();<br /><pre
class="example">PQsetNoticeProcessor(ADOConnection,PQnoticeProcessor, returnvalue);<br /></pre>right?...<br /><br />---
On<b>Sun, 5/10/09, Jasen Betts <i><jasen@xnet.co.nz></i></b> wrote:<br /><blockquote style="border-left: 2px
solidrgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br />From: Jasen Betts <jasen@xnet.co.nz><br
/>Subject:Re: [SQL] RAISE NOTICE<br />To: pgsql-sql@postgresql.org<br />Date: Sunday, May 10, 2009, 10:57 AM<br /><br
/><divclass="plainMail">On 2009-05-08, Luigi N. Puleio <<a href="/mc/compose?to=npuleio@rocketmail.com"
ymailto="mailto:npuleio@rocketmail.com">npuleio@rocketmail.com</a>>wrote:<br />><br />>
--0-1541576050-1241773508=:80512<br/>> Content-Type: text/plain; charset=us-ascii<br />><br />> Hello
everyone...<br/>><br />> I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE can't be
shownon windows with a popup message like the EXCEPTION, indeed it goes to log messages list..<br />> So, is there
anyway to show a popup message with a custom textmessage on it from a PL/PgSQL function?...<br /><br />postgres doesn't
producepopups (your application does that)<br /><br />To get notification you need to call PQsetNoticeProcessor() to
registera callback function.<br /><br />-- <br />Sent via pgsql-sql mailing list (<a
href="/mc/compose?to=pgsql-sql@postgresql.org"
ymailto="mailto:pgsql-sql@postgresql.org">pgsql-sql@postgresql.org</a>)<br/>To make changes to your subscription:<br
/><ahref="http://www.postgresql.org/mailpref/pgsql-sql"
target="_blank">http://www.postgresql.org/mailpref/pgsql-sql</a><br/></div></blockquote></td></tr></table><br /> 

Re: RAISE NOTICE

От
Jasen Betts
Дата:
On 2009-05-11, Luigi N. Puleio <npuleio@rocketmail.com> wrote:
>
> --0-1686780820-1242021728=:49174
> Content-Type: text/plain; charset=us-ascii
>
> Hello Jasen,
>
> do you know if PQsetNoticeProcessor() is appliable to ADOQuery->Post()?
>
> I mean if I have an event where there's ADOQuery->Post(), should I do something like:
>
> returnvalue = ADOQuery->Post();
> PQsetNoticeProcessor(ADOConnection, PQnoticeProcessor, returnvalue);
> right?...

I suspect that you'll need to get the PQ connection from ADO
and use that in the PQsetNoticeProcessor call. this may not be easy.

OTOH ADO may already do that if you can fogure out how to enable the
feature.


> --- On Sun, 5/10/09, Jasen Betts <jasen@xnet.co.nz> wrote:
>
> From: Jasen Betts <jasen@xnet.co.nz>
> Subject: Re: [SQL] RAISE NOTICE
> To: pgsql-sql@postgresql.org
> Date: Sunday, May 10, 2009, 10:57 AM
>
> On 2009-05-08, Luigi N. Puleio <npuleio@rocketmail.com> wrote:
>>
>> --0-1541576050-1241773508=:80512
>> Content-Type: text/plain; charset=us-ascii
>>
>> Hello everyone...
>>
>> I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE can't be shown on windows with a popup
messagelike the EXCEPTION, indeed it goes to log messages list..
 
>> So, is there any way to show a popup message with a custom textmessage on it from a PL/PgSQL function?...
>
> postgres doesn't produce popups (your application does that)
>
> To get notification you need to call PQsetNoticeProcessor() to register a callback function.
>