pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to get RAISE INFO in JDBC
2+ messages / 2 participants
[nested] [flat]

* How to get RAISE INFO in JDBC
@ 2020-03-20 14:48  Ravi Krishna <srkrishna@outlook.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Ravi Krishna @ 2020-03-20 14:48 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

How do we get the notification mentioned in RAISE INFO of PL/PGSQL in JDBC. 
I can get it in psql, but not in JDBC.

I am talking about redshift which has the same procedural language like postgres.

thanks






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

* Re: How to get RAISE INFO in JDBC
@ 2020-03-20 16:12  Thomas Kellerer <shammat@gmx.net>
  parent: Ravi Krishna <srkrishna@outlook.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Thomas Kellerer @ 2020-03-20 16:12 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Ravi Krishna schrieb am 20.03.2020 um 15:48:
> How do we get the notification mentioned in RAISE INFO of PL/PGSQL in JDBC.
> I can get it in psql, but not in JDBC.
>
> I am talking about redshift which has the same procedural language like postgres.

I can only answer this for Postgres.
As Redhisft has its own JDBC driver, I don't know if this applies to that as well:

All messages from a RAISE are reported as SQL Warnings on the Statement instance that you used.

So you can use Statement.getWarnings() to retrieve the RAISE output.
Note, that you need a loop that checks SQLWarning.getNextWarning() to find out if there was more than one RAISE

Thomas







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


end of thread, other threads:[~2020-03-20 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 14:48 How to get RAISE INFO in JDBC Ravi Krishna <srkrishna@outlook.com>
2020-03-20 16:12 ` Thomas Kellerer <shammat@gmx.net>

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