Re: BUG #16557: getProcedureColumns() function returns columns, when there is no existing Stored Procedure in the DB

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: adarshdeep(dot)cheema(at)ibm(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16557: getProcedureColumns() function returns columns, when there is no existing Stored Procedure in the DB
Date: 2020-09-01 22:35:46
Message-ID: CADK3HHLR9QeR+Ce25GO_1Z9a856dxJzEPGjhHuPxVcOZDPx+uw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

This has been fixed in
https://github.com/pgjdbc/pgjdbc/pull/1723
Please upgrade the driver
Dave Cramer
www.postgres.rocks

On Mon, 27 Jul 2020 at 13:47, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 16557
> Logged by: Adarshdeep Cheema
> Email address: adarshdeep(dot)cheema(at)ibm(dot)com
> PostgreSQL version: 12.2
> Operating system: Windows
> Description:
>
> Create any user defined function using Postgres 12.3 Server, we are using
> postgresql-42.2.11 JDBC driver
>
> DDLs:
> CREATE FUNCTION findec(pdec numeric) RETURNS numeric
> LANGUAGE plpgsql
> AS $$
> declare r decimal(7,2);
> begin
> r = PDEC;
> return r;
> end;
> $$;
>
>
> a) When we use the following Java code, then we get nothing as we do no
> have
> any Stored Procedure defined, which is expected
> resultSet= metadata.getProcedures(null , "public", null); ,
> while (resultSet.next()){
>
> System.out.print(resultSet.getString(1)+" ");
> System.out.print(resultSet.getString(2)+" ");
> System.out.print(resultSet.getString(3)+" ");
> System.out.print(resultSet.getString(4)+" ");
> System.out.print(resultSet.getString(5)+" ");
> System.out.println(resultSet.getString(6)+" ");
> }
>
> b) Now change the JAVA code to the following and you will get two columns
> in
> the resultSet, which is a bug as there is no StoredProcedure Defined in the
> database
>
> resultSet= metadata.getProcedureColumns(null , "public", "findec", null);
> ,
> while (resultSet.next()){
>
> System.out.print(resultSet.getString(1)+" ");
> System.out.print(resultSet.getString(2)+" ");
> System.out.print(resultSet.getString(3)+" ");
> System.out.print(resultSet.getString(4)+" ");
> System.out.print(resultSet.getString(5)+" ");
> System.out.println(resultSet.getString(6)+" ");
> }
>
>
> OUTPUT:
> null public findec returnValue 5 2
> null public findec pdec 1 2
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2020-09-01 23:01:22 Re: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
Previous Message Bruce Momjian 2020-09-01 20:38:46 Re: BUG #16486: Prompted password is ignored when password specified in connection string