Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PgDatabaseMetaData getFunctions returns procedures #1771

Closed
snoboy05 opened this issue May 4, 2020 · 4 comments
Closed

PgDatabaseMetaData getFunctions returns procedures #1771

snoboy05 opened this issue May 4, 2020 · 4 comments

Comments

@snoboy05
Copy link

snoboy05 commented May 4, 2020

Describe the issue
PgDatabaseMetaData.getFunctions() returns also procedures.

Driver Version?
42.2.12
Java Version?
Any
OS Version?
Any
PostgreSQL Version?
12.2
To Reproduce
Steps to reproduce the behaviour:
Create functions and procedures in PostgreSQL, and use PgDatabaseMetaData getFunctions You will get functions returned in the list as well as procedures.
Expected behaviour
PgDatabaseMetaData getFunctions should only return functions. (see also #1340)

@davecramer
Copy link
Member

davecramer commented May 4, 2020

are you suggesting that PR 1723 doesn't do what it says it does ?

@snoboy05
Copy link
Author

snoboy05 commented May 4, 2020

Yes

getProcedures() returns only procedures -> OK
getFunctions() returns functions and procedures -> NOK

@davecramer
Copy link
Member

davecramer commented May 4, 2020

Thanks for the report. Care to provide a PR to fix it ?

@snoboy05
Copy link
Author

snoboy05 commented May 5, 2020

Sorry, I'm not familiary with git. But I can provide the possible solution.

getFunctions() (line 2752) add line below to filter the functions (see also getProcedures() line 1041):

sql += " AND p.prokind='f'";

kili668 pushed a commit to kili668/pgjdbc that referenced this issue May 7, 2020
davecramer pushed a commit to davecramer/pgjdbc that referenced this issue Jul 5, 2021
* Fix pgjdbc#1771

Only return functions and not procedures for servers v11 and up.

Co-authored-by: kfe <kfe@kili668>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants