Re: Using \errverbose through JDBC
От
Thomas Kellerer
Тема
Re: Using \errverbose through JDBC
Дата
Msg-id
o6t061$4at$2@blaine.gmane.org
Ответ на
Re: [JDBC] Using \errverbose through JDBC (Jorge Solórzano)
Список
Дерево обсуждения
[JDBC] Using \errverbose through JDBC Thomas Kellerer <spam_eater@gmx.net>
Re: Using \errverbose through JDBC Jorge Solórzano <jorsol@gmail.com>
Re: [JDBC] Using \errverbose through JDBC Tom Lane <tgl@sss.pgh.pa.us>
Re: [JDBC] Using \errverbose through JDBC Thomas Kellerer <spam_eater@gmx.net>
Re: [JDBC] Using \errverbose through JDBC Thomas Kellerer <spam_eater@gmx.net>
Re: Using \errverbose through JDBC Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Re: [JDBC] Using \errverbose through JDBC Thomas Kellerer <spam_eater@gmx.net>
Re: Using \errverbose through JDBC Dave Cramer <pg@fastcrypt.com>
Re: [JDBC] Using \errverbose through JDBC Dave Cramer <pg@fastcrypt.com>
Jorge Solórzano schrieb am 01.02.2017 um 16:11:
> The use case for this is?
>
> AFAICT this is a libpq functionality, and since the JDBC driver is not libpq based then it can't use that functionality.
>
> And it doesn't looks to be that useful for JDBC users:
I think it would:
postgres> \set VERBOSITY verbose
postgres> insert into foobar (data) values ('x');
ERROR: 23502: null value in column "id" violates not-null constraint
DETAIL: Failing row contains (null, x).
SCHEMA NAME: public
TABLE NAME: foobar
COLUMN NAME: id
LOCATION: ExecConstraints, execMain.c:1732
postgres>
When you run such an insert via JDBC, you'd only have "null value in column "id" violates not-null constraint" in the SQL Exception's message.
But for logging purposes (on the client) it would be interesting to get details about the table into which the insert was done.
This would enable to show those details (e.g. the table that was affected) in tools like SQL Workbench
Vladimir pointed me into the right direction. Those details are already available through the Postgres JDBC driver.
В списке pgsql-jdbc по дате отправления