Re: Can't run CREATE PROCEDURE with new Postgres' 14 new SQL-standard body

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: List <pgsql-jdbc(at)postgresql(dot)org>
Cc: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
Subject: Re: Can't run CREATE PROCEDURE with new Postgres' 14 new SQL-standard body
Date: 2021-10-04 15:27:32
Message-ID: 12605f56-a371-04cd-1b65-ea2eb12ad835@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Sehrope Sarkuni schrieb am 04.10.2021 um 14:49:
> On Sun, Oct 3, 2021 at 8:08 AM Thomas Kellerer <shammat(at)gmx(dot)net <mailto:shammat(at)gmx(dot)net>> wrote:
>
> Postgres 14 supports SQL standard conforming bodies for functions and procedures
> which are no longer string constants, e.g.
>
> create or replace procedure do_stuff()
>   language sql
>   begin atomic
>     select 1;
>     select 2;
>   end
>
> However, it seems that the JDBC driver will parse the string and split it into
> multiple statements based on the semicolons thus making it an invalid create procedure
> statement.
>
>
> If you set the connection property "preferQueryMode" to "simple" or
> "extendedForPrepared", then the driver will not attempt to split the
> statement into multiple commands.

Thanks, that works fine.

Changing the connection URL is a good enough solution for me.

Thomas

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2021-10-05 13:03:33 Re: Can't run CREATE PROCEDURE with new Postgres' 14 new SQL-standard body
Previous Message Dave Cramer 2021-10-04 13:50:58 [pgjdbc/pgjdbc] 04b728: Revert "fix: try to read any notifies or errors th...