agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] Raise "NOTICE" with pljava
3+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Raise "NOTICE" with pljava
@ 2005-05-10 18:18 
  2005-05-11 14:36 ` [Pljava-dev] Re: Raise "NOTICE" with pljava 
  0 siblings, 1 reply; 3+ messages in thread

From:  @ 2005-05-10 18:18 UTC (permalink / raw)

Hello,
In plpgsql we can raise "notice" with command "RAISE NOTICE" - I don't 
see any build-in pljava methods to raise notice or I'm wrong ? I know 
that I can raise warning with standard SQLWarning object, but "warning" 
is not equal to "notice". Very simple solution is to write e.g. 
raiseNotice(varchar) method in plpgsql, but I would like to know if 
there is any native method.

Thanks.

ML





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Re: Raise "NOTICE" with pljava
  2005-05-10 18:18 [Pljava-dev] Raise "NOTICE" with pljava 
@ 2005-05-11 14:36 ` 
  2005-05-11 15:00   ` [Pljava-dev] Re: Raise "NOTICE" with pljava 
  0 siblings, 1 reply; 3+ messages in thread

From:  @ 2005-05-11 14:36 UTC (permalink / raw)

Marek Lewczuk wrote:
> Hello,
> In plpgsql we can raise "notice" with command "RAISE NOTICE" - I don't 
> see any build-in pljava methods to raise notice or I'm wrong ? I know 
> that I can raise warning with standard SQLWarning object, but "warning" 
> is not equal to "notice". Very simple solution is to write e.g. 
> raiseNotice(varchar) method in plpgsql, but I would like to know if 
> there is any native method.
> 
Errors and messages are handled using the standard java.util.logging 
facility. PL/Java comes with a special logger that sits on top of the 
PostgreSQL error and message reporting system.

		Logger log = Logger.getAnonymousLogger();
		log.info("a message for level INFO");
		log.warning("a message for level WARNING");
		log.fine("a message for level DEBUG1");
		log.finer("a message for level DEBUG2");
		log.finest("a message for level DEBUG3");

Messages intended for level Error should not use the logger but instead 
throw an SQLException.

The mapping is hardcoded at present. You can use the internal Backend 
class directly although I cannot guarantee that it will be portable 
across versions. It's possible to write:

   Backend.log(ELogHandler.LOG_NOTICE, "a message for level NOTICE");

that is equivalient to RAISE NOTICE in PL/pgsql.

Regards,
Thomas Hallgren





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Re: Raise "NOTICE" with pljava
  2005-05-10 18:18 [Pljava-dev] Raise "NOTICE" with pljava 
  2005-05-11 14:36 ` [Pljava-dev] Re: Raise "NOTICE" with pljava 
@ 2005-05-11 15:00   ` 
  0 siblings, 0 replies; 3+ messages in thread

From:  @ 2005-05-11 15:00 UTC (permalink / raw)

Thomas Hallgren napisa?(a):
> Marek Lewczuk wrote:
> that is equivalient to RAISE NOTICE in PL/pgsql.
Great. Thanks a lot.

ML





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-05-11 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-05-10 18:18 [Pljava-dev] Raise "NOTICE" with pljava 
2005-05-11 14:36 ` 
2005-05-11 15:00   ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox