Re: Unrecognized type error (postgres 9.1.4) - Mailing list pgsql-hackers

From Rodrigo Barboza
Subject Re: Unrecognized type error (postgres 9.1.4)
Date
Msg-id CANs8QJZvaQ+V=ELpjJAxKkG0pQ=UOXaVq09ZSSEWQdodJAiZNg@mail.gmail.com
Whole thread Raw
In response to Re: Unrecognized type error (postgres 9.1.4)  (Rodrigo Barboza <rodrigombufrj@gmail.com>)
Responses Re: Unrecognized type error (postgres 9.1.4)
Re: Unrecognized type error (postgres 9.1.4)
List pgsql-hackers



On Sat, Apr 6, 2013 at 10:39 PM, Rodrigo Barboza <rodrigombufrj@gmail.com> wrote:
Ok! I will try to reproduce in a smaller scenario. 


On Sat, Apr 6, 2013 at 9:53 PM, Amit Kapila <amit.kapila@huawei.com> wrote:
On Saturday, April 06, 2013 12:18 PM Rodrigo Barboza wrote:
>On Sat, Apr 6, 2013 at 12:23 AM, Amit Kapila <amit.kapila@huawei.com>
wrote:
>> On Saturday, April 06, 2013 3:57 AM Rodrigo Barboza wrote:

>>Hello.
>> I created a type my_uint that is a unsigned int 32.

>> I am trying to update data of a table that contains a column of this
type.
>> Here is what happens:

>> postgresql=> explain analyze UPDATE attribute_type_conf SET rowform =
rowform +1 where rowform <= 18;
>> ERROR:  unsupported type: 132852
>> Can you post your complete test (like your type creation and its use for
>> table and any initial data you loaded to it)?



> Well, it's a lot of data.
> May I send it atached?
If you can't make it to small reproducible test, then you can send.

With Regards,
Amit Kapila.



I was trying to reproduce the error, but it is was not raising error.
I didn't change anything.
Last week I dropped the database, created it again, populated my db and when it was time to run the query, the error raised.
I'm puzzled. I can't trust it...

But now I run this script and the error finally raised. It seems random.

psql -U testuser testdb -c "drop table if exists tm32;"
psql -U testuser testdb -c "create table tm32 (a tmuint32);"


for ((i=0; i<100; i++));do
psql -U testuser testdb <<ENDOFSQLDATA
insert into tm32 values($i);
ENDOFSQLDATA
done

for ((i=0; i<100; i++ )); do
psql -U testuser testdb <<ENDOFSQLDATA
BEGIN;
UPDATE tm32 SET a = a + 1 WHERE a > $i;
END;
ENDOFSQLDATA
done

The error message: 
ERROR: unsupported type: 202886
ROLLBACK


Here is my script for creating the types. I changed the installation path to a generic name in this email to be clear where to put the path to the so files.


#!/bin/sh

export PGPASSWORD=mypass

psql -U root testdb --quiet -v ON_ERROR_STOP=1 trafip <<ENDOFSQLDATA
BEGIN;

CREATE TYPE tmuint32;
CREATE TYPE tmuint64;

CREATE FUNCTION tmuint32_in(cstring)
RETURNS tmuint32
AS '/my/install/dir/tmuint32'
LANGUAGE C IMMUTABLE STRICT;


CREATE FUNCTION tmuint32_out(tmuint32)
RETURNS cstring 
AS '/my/install/dir/tmuint32'
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint32_recv(internal)
RETURNS tmuint32
AS '/my/install/dir/tmuint32'
LANGUAGE C IMMUTABLE STRICT;


CREATE FUNCTION tmuint32_send(tmuint32)
RETURNS bytea
AS '/my/install/dir/tmuint32'
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint64_in(cstring) 
RETURNS tmuint64 
AS '/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint64_out(tmuint64) 
RETURNS cstring AS 
'/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint64_recv(internal) 
RETURNS tmuint64 AS 
'/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint64_send(tmuint64) 
RETURNS bytea AS 
'/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;


CREATE TYPE tmuint32 (
internallength = 4,
input = tmuint32_in,
output = tmuint32_out,
receive = tmuint32_recv,
send = tmuint32_send,
alignment = int
);

CREATE TYPE tmuint64 (
internallength = 8,
input = tmuint64_in,
output = tmuint64_out,
receive = tmuint64_recv,
send = tmuint64_send,
alignment = double
);

CREATE FUNCTION int2_to_tmuint32(int2) 
RETURNS tmuint32
AS '/my/install/dir/tmuint32'
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION int4_to_tmuint32(int4) 
RETURNS tmuint32
AS '/my/install/dir/tmuint32'
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION int8_to_tmuint32(int8) 
RETURNS tmuint32
AS '/my/install/dir/tmuint32'
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION int2_to_tmuint64(int2) 
RETURNS tmuint64 
AS '/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION int4_to_tmuint64(int4) 
RETURNS tmuint64 
AS '/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION int8_to_tmuint64(int8) 
RETURNS tmuint64 
AS '/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION numeric_to_tmuint64(numeric) 
RETURNS tmuint64 
AS '/my/install/dir/tmuint64' 
LANGUAGE C IMMUTABLE STRICT;

CREATE CAST (int2 AS tmuint32) WITH FUNCTION int2_to_tmuint32(int2) AS ASSIGNMENT;
CREATE CAST (int4 AS tmuint32) WITH FUNCTION int4_to_tmuint32(int4) AS ASSIGNMENT;
CREATE CAST (int8 AS tmuint32) WITH FUNCTION int8_to_tmuint32(int8) AS ASSIGNMENT;

CREATE CAST (int2 AS tmuint64) WITH FUNCTION int2_to_tmuint64(int2) AS ASSIGNMENT;
CREATE CAST (int4 AS tmuint64) WITH FUNCTION int4_to_tmuint64(int4) AS ASSIGNMENT;
CREATE CAST (int8 AS tmuint64) WITH FUNCTION int8_to_tmuint64(int8) AS ASSIGNMENT;

CREATE CAST (numeric AS tmuint64) WITH FUNCTION numeric_to_tmuint64(numeric) AS ASSIGNMENT;

CREATE FUNCTION tmuint32_int16_add(tmuint32, int2) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_add(tmuint32, int4) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_add(int2, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_add(int4, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_add(tmuint32, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int16_sub(tmuint32, int2) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_sub(tmuint32, int4) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_sub(int2, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_sub(int4, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_sub(tmuint32, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int16_mul(tmuint32, int2) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_mul(tmuint32, int4) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_mul(int2, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_mul(int4, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_mul(tmuint32, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int16_div(tmuint32, int2) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_div(tmuint32, int4) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_div(int2, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_div(int4, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_div(tmuint32, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint32_accum(tmuint64[], tmuint32) RETURNS tmuint64[] AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_avg(tmuint64[]) RETURNS float8 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_max(tmuint32, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_min(tmuint32, tmuint32) RETURNS tmuint32 AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint64_tmuint64_add(tmuint64, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_add(tmuint64, smallint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_add(tmuint64, integer) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_add(tmuint64, bigint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_add(smallint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_add(integer, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_add(bigint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_tmuint64_sub(tmuint64, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_sub(tmuint64, smallint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_sub(tmuint64, integer) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_sub(tmuint64, bigint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_sub(smallint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_sub(integer, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_sub(bigint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_tmuint64_mul(tmuint64, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_mul(tmuint64, smallint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_mul(tmuint64, integer) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_mul(tmuint64, bigint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_mul(smallint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_mul(integer, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_mul(bigint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_tmuint64_div(tmuint64, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_div(tmuint64, smallint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_div(tmuint64, integer) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_div(tmuint64, bigint) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_div(smallint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_div(integer, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_div(bigint, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;


CREATE FUNCTION tmuint64_accum(tmuint64[], tmuint64) RETURNS tmuint64[] AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_avg(tmuint64[]) RETURNS float8 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_max(tmuint64, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_min(tmuint64, tmuint64) RETURNS tmuint64 AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;

CREATE OPERATOR + ( leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_add);
CREATE OPERATOR + ( leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_add);
CREATE OPERATOR + ( leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_add);
CREATE OPERATOR + ( leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_add);
CREATE OPERATOR + ( leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_add);
CREATE OPERATOR - ( leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_sub);
CREATE OPERATOR - ( leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_sub);
CREATE OPERATOR - ( leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_sub);
CREATE OPERATOR - ( leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_sub);
CREATE OPERATOR - ( leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_sub);
CREATE OPERATOR * ( leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_mul);
CREATE OPERATOR * ( leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_mul);
CREATE OPERATOR * ( leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_mul);
CREATE OPERATOR * ( leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_mul);
CREATE OPERATOR * ( leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_mul);
CREATE OPERATOR / ( leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_div);
CREATE OPERATOR / ( leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_div);
CREATE OPERATOR / ( leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_div);
CREATE OPERATOR / ( leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_div);
CREATE OPERATOR / ( leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_div);

CREATE OPERATOR + (leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_add);
CREATE OPERATOR + (leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_add);
CREATE OPERATOR + (leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_add);
CREATE OPERATOR + (leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_add);
CREATE OPERATOR + (leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_add);
CREATE OPERATOR + (leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_add);
CREATE OPERATOR + (leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_add);
CREATE OPERATOR - (leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_sub);
CREATE OPERATOR - (leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_sub);
CREATE OPERATOR - (leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_sub);
CREATE OPERATOR - (leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_sub);
CREATE OPERATOR - (leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_sub);
CREATE OPERATOR - (leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_sub);
CREATE OPERATOR - (leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_sub);
CREATE OPERATOR * (leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_mul);
CREATE OPERATOR * (leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_mul);
CREATE OPERATOR * (leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_mul);
CREATE OPERATOR * (leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_mul);
CREATE OPERATOR * (leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_mul);
CREATE OPERATOR * (leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_mul);
CREATE OPERATOR * (leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_mul);
CREATE OPERATOR / (leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_div);
CREATE OPERATOR / (leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_div);
CREATE OPERATOR / (leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_div);
CREATE OPERATOR / (leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_div);
CREATE OPERATOR / (leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_div);
CREATE OPERATOR / (leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_div);
CREATE OPERATOR / (leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_div);

CREATE AGGREGATE sum (tmuint32)
(
sfunc = tmuint32_tmuint32_add,
stype = tmuint32,
initcond = '0'
);

CREATE AGGREGATE max (tmuint32)
(
sfunc = tmuint32_max,
stype = tmuint32
);

CREATE AGGREGATE min (tmuint32)
(
sfunc = tmuint32_min,
stype = tmuint32
);

CREATE AGGREGATE avg (tmuint32)
(
sfunc = tmuint32_accum,
stype = tmuint64[],
finalfunc = tmuint32_avg,
initcond = '{0,0}'
);

CREATE AGGREGATE sum (tmuint64)
(
sfunc = tmuint64_tmuint64_add,
stype = tmuint64,
initcond = '0'
);

CREATE AGGREGATE max (tmuint64)
(
sfunc = tmuint64_max,
stype = tmuint64
);

CREATE AGGREGATE min (tmuint64)
(
sfunc = tmuint64_min,
stype = tmuint64
);

CREATE AGGREGATE avg (tmuint64)
(
sfunc = tmuint64_accum,
stype = tmuint64[],
finalfunc = tmuint64_avg,
initcond = '{0,0}'
);

CREATE FUNCTION tmuint32_int16_abs_lt(tmuint32, int2) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_abs_lt(tmuint32, int4) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int64_abs_lt(tmuint32, int8) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_abs_lt(int2, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_abs_lt(int4, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint32_abs_lt(int8, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_abs_lt(tmuint32, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int16_abs_le(tmuint32, int2) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_abs_le(tmuint32, int4) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int64_abs_le(tmuint32, int8) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_abs_le(int2, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_abs_le(int4, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint32_abs_le(int8, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_abs_le(tmuint32, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int16_abs_eq(tmuint32, int2) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_abs_eq(tmuint32, int4) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int64_abs_eq(tmuint32, int8) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_abs_eq(int2, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_abs_eq(int4, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint32_abs_eq(int8, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_abs_eq(tmuint32, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int16_abs_ge(tmuint32, int2) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_abs_ge(tmuint32, int4) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int64_abs_ge(tmuint32, int8) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_abs_ge(int2, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_abs_ge(int4, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint32_abs_ge(int8, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_abs_ge(tmuint32, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int16_abs_gt(tmuint32, int2) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_abs_gt(tmuint32, int4) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int64_abs_gt(tmuint32, int8) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_abs_gt(int2, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_abs_gt(int4, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint32_abs_gt(int8, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_abs_gt(tmuint32, tmuint32) RETURNS bool
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION tmuint64_tmuint64_abs_lt(tmuint64, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_tmuint64_abs_le(tmuint64, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_tmuint64_abs_eq(tmuint64, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_tmuint64_abs_ge(tmuint64, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_tmuint64_abs_gt(tmuint64, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_abs_lt(tmuint64, smallint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_abs_le(tmuint64, smallint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_abs_eq(tmuint64, smallint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_abs_ge(tmuint64, smallint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_abs_gt(tmuint64, smallint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_abs_lt(smallint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_abs_le(smallint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_abs_eq(smallint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_abs_ge(smallint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_abs_gt(smallint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_abs_lt(tmuint64, integer) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_abs_le(tmuint64, integer) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_abs_eq(tmuint64, integer) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_abs_ge(tmuint64, integer) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_abs_gt(tmuint64, integer) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_abs_lt(integer, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_abs_le(integer, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_abs_eq(integer, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_abs_ge(integer, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_abs_gt(integer, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_abs_lt(tmuint64, bigint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_abs_le(tmuint64, bigint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_abs_eq(tmuint64, bigint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_abs_ge(tmuint64, bigint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_abs_gt(tmuint64, bigint) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_abs_lt(bigint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_abs_le(bigint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_abs_eq(bigint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_abs_ge(bigint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_abs_gt(bigint, tmuint64) RETURNS bool 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;


CREATE OPERATOR < (
   leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_abs_lt,
   commutator = > , negator = >= ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR < (
   leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_abs_lt,
   commutator = > , negator = >= ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR < (
   leftarg = tmuint32, rightarg = int8, procedure = tmuint32_int64_abs_lt,
   commutator = > , negator = >= ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR < (
   leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_abs_lt,
   commutator = > , negator = >= ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR < (
   leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_abs_lt,
   commutator = > , negator = >= ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR < (
   leftarg = int8, rightarg = tmuint32, procedure = int64_tmuint32_abs_lt,
   commutator = > , negator = >= ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR < (
   leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_abs_lt,
   commutator = > , negator = >= ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR <= (
   leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_abs_le,
   commutator = >= , negator = > ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR <= (
   leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_abs_le,
   commutator = >= , negator = > ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR <= (
   leftarg = tmuint32, rightarg = int8, procedure = tmuint32_int64_abs_le,
   commutator = >= , negator = > ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR <= (
   leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_abs_le,
   commutator = >= , negator = > ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR <= (
   leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_abs_le,
   commutator = >= , negator = > ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR <= (
   leftarg = int8, rightarg = tmuint32, procedure = int64_tmuint32_abs_le,
   commutator = >= , negator = > ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR <= (
   leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_abs_le,
   commutator = >= , negator = > ,
   restrict = scalarltsel, join = scalarltjoinsel
);
CREATE OPERATOR = (
   leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_abs_eq,
   commutator = = ,
   restrict = eqsel, join = eqjoinsel
);
CREATE OPERATOR = (
   leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_abs_eq,
   commutator = = ,
   restrict = eqsel, join = eqjoinsel
);
CREATE OPERATOR = (
   leftarg = tmuint32, rightarg = int8, procedure = tmuint32_int64_abs_eq,
   commutator = = ,
   restrict = eqsel, join = eqjoinsel
);
CREATE OPERATOR = (
   leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_abs_eq,
   commutator = = ,
   restrict = eqsel, join = eqjoinsel
);
CREATE OPERATOR = (
   leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_abs_eq,
   commutator = = ,
   restrict = eqsel, join = eqjoinsel
);
CREATE OPERATOR = (
   leftarg = int8, rightarg = tmuint32, procedure = int64_tmuint32_abs_eq,
   commutator = = ,
   restrict = eqsel, join = eqjoinsel
);
CREATE OPERATOR = (
   leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_abs_eq,
   commutator = = ,
   restrict = eqsel, join = eqjoinsel
);
CREATE OPERATOR >= (
   leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_abs_ge,
   commutator = <= , negator = < ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR >= (
   leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_abs_ge,
   commutator = <= , negator = < ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR >= (
   leftarg = tmuint32, rightarg = int8, procedure = tmuint32_int64_abs_ge,
   commutator = <= , negator = < ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR >= (
   leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_abs_ge,
   commutator = <= , negator = < ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR >= (
   leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_abs_ge,
   commutator = <= , negator = < ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR >= (
   leftarg = int8, rightarg = tmuint32, procedure = int64_tmuint32_abs_ge,
   commutator = <= , negator = < ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR >= (
   leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_abs_ge,
   commutator = <= , negator = < ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR > (
   leftarg = tmuint32, rightarg = int2, procedure = tmuint32_int16_abs_gt,
   commutator = < , negator = <= ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR > (
   leftarg = tmuint32, rightarg = int4, procedure = tmuint32_int32_abs_gt,
   commutator = < , negator = <= ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR > (
   leftarg = tmuint32, rightarg = int8, procedure = tmuint32_int64_abs_gt,
   commutator = < , negator = <= ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR > (
   leftarg = int2, rightarg = tmuint32, procedure = int16_tmuint32_abs_gt,
   commutator = < , negator = <= ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR > (
   leftarg = int4, rightarg = tmuint32, procedure = int32_tmuint32_abs_gt,
   commutator = < , negator = <= ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR > (
   leftarg = int8, rightarg = tmuint32, procedure = int64_tmuint32_abs_gt,
   commutator = < , negator = <= ,
   restrict = scalargtsel, join = scalargtjoinsel
);
CREATE OPERATOR > (
   leftarg = tmuint32, rightarg = tmuint32, procedure = tmuint32_tmuint32_abs_gt,
   commutator = < , negator = <= ,
   restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR < (
leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_abs_lt,
commutator = > , negator = >= ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR <= (
leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_abs_le,
commutator = >= , negator = > ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR = (
leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_abs_eq,
commutator = = ,
-- leave out negator since we didn't create <> operator
-- negator = <> ,
restrict = eqsel, join = eqjoinsel
);

CREATE OPERATOR >= (
leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_abs_ge,
commutator = <= , negator = < ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR > (
leftarg = tmuint64, rightarg = tmuint64, procedure = tmuint64_tmuint64_abs_gt,
commutator = < , negator = <= ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR < (
leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_abs_lt,
commutator = > , negator = >= ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR <= (
leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_abs_le,
commutator = >= , negator = > ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR = (
leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_abs_eq,
commutator = = ,
-- leave out negator since we didn't create <> operator
-- negator = <> ,
restrict = eqsel, join = eqjoinsel
);

CREATE OPERATOR >= (
leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_abs_ge,
commutator = <= , negator = < ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR > (
leftarg = tmuint64, rightarg = smallint, procedure = tmuint64_int16_abs_gt,
commutator = < , negator = <= ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR < (
leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_abs_lt,
commutator = > , negator = >= ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR <= (
leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_abs_le,
commutator = >= , negator = > ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR = (
leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_abs_eq,
commutator = = ,
-- leave out negator since we didn't create <> operator
-- negator = <> ,
restrict = eqsel, join = eqjoinsel
);

CREATE OPERATOR >= (
leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_abs_ge,
commutator = <= , negator = < ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR > (
leftarg = smallint, rightarg = tmuint64, procedure = int16_tmuint64_abs_gt,
commutator = < , negator = <= ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR < (
leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_abs_lt,
commutator = > , negator = >= ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR <= (
leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_abs_le,
commutator = >= , negator = > ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR = (
leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_abs_eq,
commutator = = ,
-- leave out negator since we didn't create <> operator
-- negator = <> ,
restrict = eqsel, join = eqjoinsel
);

CREATE OPERATOR >= (
leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_abs_ge,
commutator = <= , negator = < ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR > (
leftarg = tmuint64, rightarg = integer, procedure = tmuint64_int32_abs_gt,
commutator = < , negator = <= ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR < (
leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_abs_lt,
commutator = > , negator = >= ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR <= (
leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_abs_le,
commutator = >= , negator = > ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR = (
leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_abs_eq,
commutator = = ,
-- leave out negator since we didn't create <> operator
-- negator = <> ,
restrict = eqsel, join = eqjoinsel
);

CREATE OPERATOR >= (
leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_abs_ge,
commutator = <= , negator = < ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR > (
leftarg = integer, rightarg = tmuint64, procedure = int32_tmuint64_abs_gt,
commutator = < , negator = <= ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR < (
leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_abs_lt,
commutator = > , negator = >= ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR <= (
leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_abs_le,
commutator = >= , negator = > ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR = (
leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_abs_eq,
commutator = = ,
-- leave out negator since we didn't create <> operator
-- negator = <> ,
restrict = eqsel, join = eqjoinsel
);

CREATE OPERATOR >= (
leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_abs_ge,
commutator = <= , negator = < ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR > (
leftarg = tmuint64, rightarg = bigint, procedure = tmuint64_int64_abs_gt,
commutator = < , negator = <= ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR < (
leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_abs_lt,
commutator = > , negator = >= ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR <= (
leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_abs_le,
commutator = >= , negator = > ,
restrict = scalarltsel, join = scalarltjoinsel
);

CREATE OPERATOR = (
leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_abs_eq,
commutator = = ,
-- leave out negator since we didn't create <> operator
-- negator = <> ,
restrict = eqsel, join = eqjoinsel
);

CREATE OPERATOR >= (
leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_abs_ge,
commutator = <= , negator = < ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE OPERATOR > (
leftarg = bigint, rightarg = tmuint64, procedure = int64_tmuint64_abs_gt,
commutator = < , negator = <= ,
restrict = scalargtsel, join = scalargtjoinsel
);

CREATE FUNCTION tmuint32_int16_abs_cmp(tmuint32, int2) RETURNS int4
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_int32_abs_cmp(tmuint32, int4) RETURNS int4
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint32_abs_cmp(int2, tmuint32) RETURNS int4
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint32_abs_cmp(int4, tmuint32) RETURNS int4
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint32_tmuint32_abs_cmp(tmuint32, tmuint32) RETURNS int4
   AS '/my/install/dir/tmuint32' LANGUAGE C IMMUTABLE STRICT;

CREATE OPERATOR CLASS tmuint32_tmuint32_abs_ops
    DEFAULT FOR TYPE tmuint32 USING btree AS
        OPERATOR        1       < ,
        OPERATOR        2       <= ,
        OPERATOR        3       = ,
        OPERATOR        4       >= ,
        OPERATOR        5       > ,
        FUNCTION        1       tmuint32_tmuint32_abs_cmp(tmuint32, tmuint32);

CREATE FUNCTION tmuint64_tmuint64_abs_cmp(tmuint64, tmuint64) RETURNS int4 
AS '/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int16_abs_cmp(tmuint64, smallint) RETURNS int4 AS 
'/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int32_abs_cmp(tmuint64, integer) RETURNS int4 AS 
'/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION tmuint64_int64_abs_cmp(tmuint64, bigint) RETURNS int4 AS 
'/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int16_tmuint64_abs_cmp(smallint, tmuint64) RETURNS int4 AS 
'/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int32_tmuint64_abs_cmp(integer, tmuint64) RETURNS int4 AS 
'/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION int64_tmuint64_abs_cmp(bigint, tmuint64) RETURNS int4 AS 
'/my/install/dir/tmuint64' LANGUAGE C IMMUTABLE STRICT;

CREATE OPERATOR CLASS tmuint64_tmuint64_abs_ops DEFAULT FOR TYPE tmuint64 USING btree AS
OPERATOR        1       < ,
OPERATOR        2       <= ,
OPERATOR        3       = ,
OPERATOR        4       >= ,
OPERATOR        5       > ,
FUNCTION        1       tmuint64_tmuint64_abs_cmp(tmuint64, tmuint64);

END;
ENDOFSQLDATA

unset PGPASSWORD


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: commit dfda6ebaec67 versus wal_keep_segments
Next
From: Brendan Jurd
Date:
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)