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
238 stars 77 forks source link

Fail validation if TRANSFORM FOR TYPE declared #404

Closed jcflack closed 1 year ago

jcflack commented 2 years ago

The TRANSFORM FOR TYPE mechanism is only meaningful for a PL whose handler function itself does the work of looking up and applying the transforms.

https://www.postgresql.org/message-id/61FDBCFE.3090800%40anastigmatix.net

This PL doesn't, so say so when validating a function declaration that includes a TRANSFORM clause. Addresses #402.

It would arguably be better to say so even earlier, at an attempted CREATE TRANSFORM for the PL, but PostgreSQL does not currently apply any PL-specific validator function at that time. An event trigger could be used, but that would be far too much fuss just to provide a better message in an event so unlikely to occur.