From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to get RAISE INFO in JDBC
Date: Fri, 20 Mar 2020 17:12:16 +0100
Message-ID: <1c83d660-79ce-efb3-3dd5-fa968d98f9f6@gmx.net> (raw)
In-Reply-To: <DD79A238-409F-4A06-95BF-A0A95CF45FAE@outlook.com>
References: <DD79A238-409F-4A06-95BF-A0A95CF45FAE@outlook.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: shammat@gmx.net
Subject: Re: How to get RAISE INFO in JDBC
In-Reply-To: <1c83d660-79ce-efb3-3dd5-fa968d98f9f6@gmx.net>
References: <DD79A238-409F-4A06-95BF-A0A95CF45FAE@outlook.com> <1c83d660-79ce-efb3-3dd5-fa968d98f9f6@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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