I have problems calling a PostgreSQL function from JDBC with circumstances as follows. Stored function endpoint_organizations is defined like this:
postgres=# \df public.endpoint_organizations
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+------------------------+------------------------------------------+---------------------+--------
public | endpoint_organizations | TABLE(organizationid integer, name text) | staffid1 integer | normal
(1 row)
I am calling it from Java like this:
int staffId = 1
PreparedStatement endpointOrganizations = connection.prepareStatement("SELECT * FROM endpoint_organizations (?)");
endpointOrganizations.setInt(1, staffId);
ResultSet resultSet = endpointOrganizations.executeQuery();
And I receive this exception:
org.postgresql.util.PSQLException:
ERROR: function endpoint_organizations(integer) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 15
What could be the reason why? If I am not mistaken, this has worked before. I've double-checked and triple-checked now, but don't see what might cause the problem.
psql -U <user>into the database andselect * from endpoint_organizations(1)there, things work fine.