tada / pljava

PL/Java is a free add-on module that brings Java™ Stored Procedures, Triggers, Functions, Aggregates, Operators, Types, etc., to the PostgreSQL™ backend.
http://tada.github.io/pljava/
Other
242 stars 77 forks source link

Emit correct SQL declaration for one OUT parameter #393

Closed jcflack closed 2 years ago

jcflack commented 2 years ago

When generating a function declaration for a function with exactly one OUT parameter, the declaration must have the scalar form where RETURNS identifies the single parameter's own type instead of RECORD.

Discussion: https://www.postgresql.org/message-id/619BBE78.7040009%40anastigmatix.net

Added more checks on co-appearance of type= and out= and a way to use @SQLType to disambiguate in cases where the method "shape" would fit a composite-returning method or an ordinary method with a row-typed trailing input parameter.

In cases where PL/Java has relied on an assumption in generating a function's declaration (some of the assumptions have long standing in PL/Java history), it still proceeds silently at compile time, but generates a comment into the deployment descriptor identifying the assumption and how to annotate the method if a different interpretation is intended.

Addresses #386.