BUG #15515: DatabaseMetadata.getProcedures and getFunctions return objects of either type

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: mainstreet439(at)gmail(dot)com
Subject: BUG #15515: DatabaseMetadata.getProcedures and getFunctions return objects of either type
Date: 2018-11-21 13:21:33
Message-ID: 15515-38aa73ff7b24bf28@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15515
Logged by: main street
Email address: mainstreet439(at)gmail(dot)com
PostgreSQL version: 11.1
Operating system: windows
Description:

When an application calls DatabaseMetadata.getFunctions the Resultset
returned by the driver may include functions and vice versa re
DatabaseMetadata.getProcedures.

Using various PostregSQL JDBC drivers such as 42.2.5 against PostgresSQL 11
or pre-11 servers will return both types of objects.

In essence, we might expect the driver to treat a void return type as being
an indicator of a procedure versus a function if the pre-11 style of syntax
was used.
Using the new PostgresSQL 11 CREATE PROCEDURE syntax does not change the
responses.

Example objects

CREATE FUNCTION pinint(pint integer) RETURNS void
LANGUAGE plpgsql
AS $$
declare
P1 integer;
begin
P1:= PINT;
end;
$$;

CREATE FUNCTION pinint(pint integer) RETURNS void
LANGUAGE plpgsql
AS $$
declare
P1 integer;
begin
P1:= PINT;
end;
$$;

If you were to inspect the Resultset returned by
DatabaseMetadata.getProcedures you will see a response as shown.
https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getProcedures-java.lang.String-java.lang.String-java.lang.String-

[null],[dbcert],[finint],[null],[null],[null],[null],[2],[finint_16395]
[null],[dbcert],[pinint],[null],[null],[null],[null],[2],[pinint_16394]

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Voillequin, Jean-Marc 2018-11-21 14:09:55 Weird "could not determine which collation to use for string comparison" with LEAST/GREATEST on PG11 procedure
Previous Message Shkola, Roman 2018-11-21 10:24:12 BYTEA data type problem