Class VarlenaUDTTest

java.lang.Object
org.postgresql.pljava.example.annotation.VarlenaUDTTest
All Implemented Interfaces:
SQLData

@SQLAction(requires="varlena UDT", install=" SELECT CASE v::text = v::javatest.VarlenaUDTTest::text WHEN true THEN javatest.logmessage(\'INFO\', \'VarlenaUDTTest works for \' || v) ELSE javatest.logmessage(\'WARNING\', \'VarlenaUDTTest fails for \' || v) END FROM (VALUES ((\'32767\')), ((\'32768\')), ((\'65536\')), ((\'1048576\'))) AS t ( v )") @BaseUDT(schema="javatest", provides="varlena UDT") public class VarlenaUDTTest extends Object implements SQLData
A User Defined Type with varlena storage, testing github issue 52. This looks from SQL like an integer type, but is stored in unary: the integer value n is represented by n a characters. That makes it easy to test how big a value gets correctly stored and retrieved. It should be about a GB, but in issue 52 was failing at 32768 because of a narrowing assignment in the native code.