Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC
Дата
Msg-id CADK3HH+EK4qM74YVGobr+oWcpe-EFoKGtQDDtt+Yd87nsVeHsQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC  ("ZhangChi" <798604270@qq.com>)
Ответы Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC
Re: BUG #19350: Short circuit optimization missed when runningsqlscriptes in JDBC
Список pgsql-bugs



On Tue, 16 Dec 2025 at 20:40, ZhangChi <798604270@qq.com> wrote:
Hi Greg,

Thanks for your reply. I can understand what you describe.

But my question is that in the CLI, the test case (like foo2) I showed can return the results. But when I run the same test case in JDBC, the test case triggers an error. I wonder why there is an inconsistency.

```
SET plan_cache_mode = force_generic_plan;
CREATE TABLE t0(c0 int4range);
INSERT INTO t0(c0) VALUES('[-1920846305,-1018839689)'::int4range);
PREPARE prepare_query (int8, int8) AS SELECT
((((((upper(t0.c0))))/($1)))*(($2::int8))) FROM ONLY t0;
EXECUTE prepare_query(0, NULL); -- trigger error in JDBC but no error in CLI
```


Possibly because JDBC does everything using the V3 protocol whereas psql does not. psql uses simple query.

Dave Cramer
www.postgres.rocks

В списке pgsql-bugs по дате отправления: