CREATE TYPE intbyval;

CREATE FUNCTION intbyval_in(cstring)
	RETURNS intbyval
	AS 'UDT[types.Int] input'
	LANGUAGE java IMMUTABLE STRICT;

CREATE FUNCTION intbyval_out(intbyval)
	RETURNS cstring
	AS 'UDT[types.Int] output'
	LANGUAGE java IMMUTABLE STRICT;

CREATE FUNCTION intbyval_recv(internal)
	RETURNS intbyval
	AS 'UDT[types.Int] receive'
	LANGUAGE java IMMUTABLE STRICT;

CREATE FUNCTION intbyval_send(intbyval)
	RETURNS bytea
	AS 'UDT[types.Int] send'
	LANGUAGE java IMMUTABLE STRICT;

CREATE TYPE intbyval (
	internallength = 4,
	input = intbyval_in,
	output = intbyval_out,
	receive = intbyval_recv,
	send = intbyval_send,
	passedbyvalue
	);

CREATE TYPE intbyref;

CREATE FUNCTION intbyref_in(cstring)
	RETURNS intbyref
	AS 'UDT[types.Int] input'
	LANGUAGE java IMMUTABLE STRICT;

CREATE FUNCTION intbyref_out(intbyref)
	RETURNS cstring
	AS 'UDT[types.Int] output'
	LANGUAGE java IMMUTABLE STRICT;

CREATE FUNCTION intbyref_recv(internal)
	RETURNS intbyref
	AS 'UDT[types.Int] receive'
	LANGUAGE java IMMUTABLE STRICT;

CREATE FUNCTION intbyref_send(intbyref)
	RETURNS bytea
	AS 'UDT[types.Int] send'
	LANGUAGE java IMMUTABLE STRICT;

CREATE TYPE intbyref (
	internallength = 4,
	input = intbyref_in,
	output = intbyref_out,
	receive = intbyref_recv,
	send = intbyref_send
	);

