--- /dev/null
+QUERY: CREATE TABLE CHAR16_TBL(f1 char16);
+QUERY: INSERT INTO CHAR16_TBL(f1) VALUES ('ABCDEFGHIJKLMNOP');
+QUERY: INSERT INTO CHAR16_TBL(f1) VALUES ('abcdefghijklmnop');
+QUERY: INSERT INTO CHAR16_TBL(f1) VALUES ('asdfghjkl;');
+QUERY: INSERT INTO CHAR16_TBL(f1) VALUES ('343f%2a');
+QUERY: INSERT INTO CHAR16_TBL(f1) VALUES ('d34aaasdf');
+QUERY: INSERT INTO CHAR16_TBL(f1) VALUES ('');
+QUERY: INSERT INTO CHAR16_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUV');
+QUERY: SELECT '' AS seven, CHAR16_TBL.*;
+seven|f1
+-----+----------------
+ |ABCDEFGHIJKLMNOP
+ |abcdefghijklmnop
+ |asdfghjkl;
+ |343f%2a
+ |d34aaasdf
+ |
+ |1234567890ABCDEF
+(7 rows)
+
+QUERY: SELECT '' AS six, c.f1 FROM CHAR16_TBL c WHERE c.f1 <> 'ABCDEFGHIJKLMNOP';
+six|f1
+---+----------------
+ |abcdefghijklmnop
+ |asdfghjkl;
+ |343f%2a
+ |d34aaasdf
+ |
+ |1234567890ABCDEF
+(6 rows)
+
+QUERY: SELECT '' AS one, c.f1 FROM CHAR16_TBL c WHERE c.f1 = 'ABCDEFGHIJKLMNOP';
+one|f1
+---+----------------
+ |ABCDEFGHIJKLMNOP
+(1 row)
+
+QUERY: SELECT '' AS three, c.f1 FROM CHAR16_TBL c WHERE c.f1 < 'ABCDEFGHIJKLMNOP';
+three|f1
+-----+----------------
+ |343f%2a
+ |
+ |1234567890ABCDEF
+(3 rows)
+
+QUERY: SELECT '' AS four, c.f1 FROM CHAR16_TBL c WHERE c.f1 <= 'ABCDEFGHIJKLMNOP';
+four|f1
+----+----------------
+ |ABCDEFGHIJKLMNOP
+ |343f%2a
+ |
+ |1234567890ABCDEF
+(4 rows)
+
+QUERY: SELECT '' AS three, c.f1 FROM CHAR16_TBL c WHERE c.f1 > 'ABCDEFGHIJKLMNOP';
+three|f1
+-----+----------------
+ |abcdefghijklmnop
+ |asdfghjkl;
+ |d34aaasdf
+(3 rows)
+
+QUERY: SELECT '' AS four, c.f1 FROM CHAR16_TBL c WHERE c.f1 >= 'ABCDEFGHIJKLMNOP';
+four|f1
+----+----------------
+ |ABCDEFGHIJKLMNOP
+ |abcdefghijklmnop
+ |asdfghjkl;
+ |d34aaasdf
+(4 rows)
+
+QUERY: SELECT '' AS seven, c.f1 FROM CHAR16_TBL c WHERE c.f1 ~ '.*';
+seven|f1
+-----+----------------
+ |ABCDEFGHIJKLMNOP
+ |abcdefghijklmnop
+ |asdfghjkl;
+ |343f%2a
+ |d34aaasdf
+ |
+ |1234567890ABCDEF
+(7 rows)
+
+QUERY: SELECT '' AS zero, c.f1 FROM CHAR16_TBL c WHERE c.f1 !~ '.*';
+zero|f1
+----+--
+(0 rows)
+
+QUERY: SELECT '' AS three, c.f1 FROM CHAR16_TBL c WHERE c.f1 ~ '[0-9]';
+three|f1
+-----+----------------
+ |343f%2a
+ |d34aaasdf
+ |1234567890ABCDEF
+(3 rows)
+
+QUERY: SELECT '' AS two, c.f1 FROM CHAR16_TBL c WHERE c.f1 ~ '.*asdf.*';
+two|f1
+---+----------
+ |asdfghjkl;
+ |d34aaasdf
+(2 rows)
+
--- /dev/null
+QUERY: CREATE TABLE CHAR8_TBL(f1 char8);
+QUERY: INSERT INTO CHAR8_TBL(f1) VALUES ('ABCDEFGH');
+QUERY: INSERT INTO CHAR8_TBL(f1) VALUES ('abcdefgh');
+QUERY: INSERT INTO CHAR8_TBL(f1) VALUES ('ZYWZ410-');
+QUERY: INSERT INTO CHAR8_TBL(f1) VALUES ('343f%2a');
+QUERY: INSERT INTO CHAR8_TBL(f1) VALUES ('d34aas');
+QUERY: INSERT INTO CHAR8_TBL(f1) VALUES ('');
+QUERY: INSERT INTO CHAR8_TBL(f1) VALUES ('1234567890');
+QUERY: SELECT '' AS seven, CHAR8_TBL.*;
+seven|f1
+-----+--------
+ |ABCDEFGH
+ |abcdefgh
+ |ZYWZ410-
+ |343f%2a
+ |d34aas
+ |
+ |12345678
+(7 rows)
+
+QUERY: SELECT '' AS six, c.f1 FROM CHAR8_TBL c WHERE c.f1 <> 'ABCDEFGH';
+six|f1
+---+--------
+ |abcdefgh
+ |ZYWZ410-
+ |343f%2a
+ |d34aas
+ |
+ |12345678
+(6 rows)
+
+QUERY: SELECT '' AS one, c.f1 FROM CHAR8_TBL c WHERE c.f1 = 'ABCDEFGH';
+one|f1
+---+--------
+ |ABCDEFGH
+(1 row)
+
+QUERY: SELECT '' AS three, c.f1 FROM CHAR8_TBL c WHERE c.f1 < 'ABCDEFGH';
+three|f1
+-----+--------
+ |343f%2a
+ |
+ |12345678
+(3 rows)
+
+QUERY: SELECT '' AS four, c.f1 FROM CHAR8_TBL c WHERE c.f1 <= 'ABCDEFGH';
+four|f1
+----+--------
+ |ABCDEFGH
+ |343f%2a
+ |
+ |12345678
+(4 rows)
+
+QUERY: SELECT '' AS three, c.f1 FROM CHAR8_TBL c WHERE c.f1 > 'ABCDEFGH';
+three|f1
+-----+--------
+ |abcdefgh
+ |ZYWZ410-
+ |d34aas
+(3 rows)
+
+QUERY: SELECT '' AS four, c.f1 FROM CHAR8_TBL c WHERE c.f1 >= 'ABCDEFGH';
+four|f1
+----+--------
+ |ABCDEFGH
+ |abcdefgh
+ |ZYWZ410-
+ |d34aas
+(4 rows)
+
+QUERY: SELECT '' AS seven, c.f1 FROM CHAR8_TBL c WHERE c.f1 ~ '.*';
+seven|f1
+-----+--------
+ |ABCDEFGH
+ |abcdefgh
+ |ZYWZ410-
+ |343f%2a
+ |d34aas
+ |
+ |12345678
+(7 rows)
+
+QUERY: SELECT '' AS zero, c.f1 FROM CHAR8_TBL c WHERE c.f1 !~ '.*';
+zero|f1
+----+--
+(0 rows)
+
+QUERY: SELECT '' AS four, c.f1 FROM CHAR8_TBL c WHERE c.f1 ~ '[0-9]';
+four|f1
+----+--------
+ |ZYWZ410-
+ |343f%2a
+ |d34aas
+ |12345678
+(4 rows)
+
+QUERY: SELECT '' AS three, c.f1 FROM CHAR8_TBL c WHERE c.f1 ~ '.*34.*';
+three|f1
+-----+--------
+ |343f%2a
+ |d34aas
+ |12345678
+(3 rows)
+
--- /dev/null
+QUERY: CREATE TABLE FLOAT4_TBL (f1 float4);
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('0.0');
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30');
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('-34.84');
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e40');
+WARN: Bad float4 input format -- overflow
+
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e40');
+WARN: Bad float4 input format -- overflow
+
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-40');
+WARN: Bad float4 input format -- underflow
+
+QUERY: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-40');
+WARN: Bad float4 input format -- underflow
+
+QUERY: SELECT '' AS five, FLOAT4_TBL.*;
+five|f1
+----+-----------
+ |0
+ |1004.3
+ |-34.84
+ |1.23457e+20
+ |1.23457e-20
+(5 rows)
+
+QUERY: SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3';
+four|f1
+----+-----------
+ |0
+ |-34.84
+ |1.23457e+20
+ |1.23457e-20
+(4 rows)
+
+QUERY: SELECT '' AS one, f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3';
+one| f1
+---+------
+ |1004.3
+(1 row)
+
+QUERY: SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1;
+three| f1
+-----+-----------
+ | 0
+ | -34.84
+ |1.23457e-20
+(3 rows)
+
+QUERY: SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3';
+three| f1
+-----+-----------
+ | 0
+ | -34.84
+ |1.23457e-20
+(3 rows)
+
+QUERY: SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1;
+four| f1
+----+-----------
+ | 0
+ | 1004.3
+ | -34.84
+ |1.23457e-20
+(4 rows)
+
+QUERY: SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3';
+four| f1
+----+-----------
+ | 0
+ | 1004.3
+ | -34.84
+ |1.23457e-20
+(4 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+-----------+------------
+ |1004.3 |-10043
+ |1.23457e+20|-1.23457e+21
+ |1.23457e-20|-1.23457e-19
+(3 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 + '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+-----------+-----------
+ |1004.3 |994.3
+ |1.23457e+20|1.23457e+20
+ |1.23457e-20|-10
+(3 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+-----------+------------
+ |1004.3 |-100.43
+ |1.23457e+20|-1.23457e+19
+ |1.23457e-20|-1.23457e-21
+(3 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+-----------+-----------
+ |1004.3 |1014.3
+ |1.23457e+20|1.23457e+20
+ |1.23457e-20|10
+(3 rows)
+
+QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT4_TBL f;
+WARN:float4div: divide by 0.0 error
+QUERY: SELECT '' AS five, FLOAT4_TBL.*;
+five|f1
+----+-----------
+ |0
+ |1004.3
+ |-34.84
+ |1.23457e+20
+ |1.23457e-20
+(5 rows)
+
+QUERY: SELECT '' AS five, f.f1, @f.f1 AS abs_f1 FROM FLOAT4_TBL f;
+five|f1 |abs_f1
+----+-----------+-----------
+ |0 |0
+ |1004.3 |1004.3
+ |-34.84 |34.84
+ |1.23457e+20|1.23457e+20
+ |1.23457e-20|1.23457e-20
+(5 rows)
+
+QUERY: UPDATE FLOAT4_TBL
+ SET f1 = FLOAT4_TBL.f1 * '-1'
+ WHERE FLOAT4_TBL.f1 > '0.0';
+QUERY: SELECT '' AS five, FLOAT4_TBL.*;
+five|f1
+----+------------
+ |0
+ |-34.84
+ |-1004.3
+ |-1.23457e+20
+ |-1.23457e-20
+(5 rows)
+
--- /dev/null
+QUERY: CREATE TABLE FLOAT8_TBL(f1 float8);
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+WARN: Bad float8 input format
+
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+WARN: Bad float8 input format
+
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+WARN: Bad float8 input format
+
+QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+WARN: Bad float8 input format
+
+QUERY: SELECT '' AS five, FLOAT8_TBL.*;
+five|f1
+----+--------------------
+ |0
+ |1004.3
+ |-34.84
+ |1.2345678901234e+200
+ |1.2345678901234e-200
+(5 rows)
+
+QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
+four|f1
+----+--------------------
+ |0
+ |-34.84
+ |1.2345678901234e+200
+ |1.2345678901234e-200
+(4 rows)
+
+QUERY: SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
+one| f1
+---+------
+ |1004.3
+(1 row)
+
+QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
+three| f1
+-----+--------------------
+ | 0
+ | -34.84
+ |1.2345678901234e-200
+(3 rows)
+
+QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
+three| f1
+-----+--------------------
+ | 0
+ | -34.84
+ |1.2345678901234e-200
+(3 rows)
+
+QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
+four| f1
+----+--------------------
+ | 0
+ | 1004.3
+ | -34.84
+ |1.2345678901234e-200
+(4 rows)
+
+QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
+four| f1
+----+--------------------
+ | 0
+ | 1004.3
+ | -34.84
+ |1.2345678901234e-200
+(4 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 * '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+--------------------+---------------------
+ |1004.3 |-10043
+ |1.2345678901234e+200|-1.2345678901234e+201
+ |1.2345678901234e-200|-1.2345678901234e-199
+(3 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 + '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+--------------------+--------------------
+ |1004.3 |994.3
+ |1.2345678901234e+200|1.2345678901234e+200
+ |1.2345678901234e-200|-10
+(3 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 / '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+--------------------+---------------------
+ |1004.3 |-100.43
+ |1.2345678901234e+200|-1.2345678901234e+199
+ |1.2345678901234e-200|-1.2345678901234e-201
+(3 rows)
+
+QUERY: SELECT '' AS three, f.f1, f.f1 - '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |x
+-----+--------------------+--------------------
+ |1004.3 |1014.3
+ |1.2345678901234e+200|1.2345678901234e+200
+ |1.2345678901234e-200|10
+(3 rows)
+
+QUERY: SELECT '' AS one, f.f1 ^ '2.0' AS square_f1
+ FROM FLOAT8_TBL f where f.f1 = '1004.3';
+one| square_f1
+---+----------
+ |1008618.49
+(1 row)
+
+QUERY: SELECT '' AS five, f.f1, @f.f1 AS abs_f1
+ FROM FLOAT8_TBL f;
+five|f1 |abs_f1
+----+--------------------+--------------------
+ |0 |0
+ |1004.3 |1004.3
+ |-34.84 |34.84
+ |1.2345678901234e+200|1.2345678901234e+200
+ |1.2345678901234e-200|1.2345678901234e-200
+(5 rows)
+
+QUERY: SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
+ FROM FLOAT8_TBL f;
+five|f1 |trunc_f1
+----+--------------------+--------------------
+ |0 |0
+ |1004.3 |1004
+ |-34.84 |-34
+ |1.2345678901234e+200|1.2345678901234e+200
+ |1.2345678901234e-200|0
+(5 rows)
+
+QUERY: SELECT '' AS five, f.f1, f.f1 % AS round_f1
+ FROM FLOAT8_TBL f;
+five|f1 |round_f1
+----+--------------------+--------------------
+ |0 |0
+ |1004.3 |1004
+ |-34.84 |-35
+ |1.2345678901234e+200|1.2345678901234e+200
+ |1.2345678901234e-200|0
+(5 rows)
+
+QUERY: SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |sqrt_f1
+-----+--------------------+---------------------
+ |1004.3 |31.6906926399535
+ |1.2345678901234e+200|1.11111110611109e+100
+ |1.2345678901234e-200|1.11111110611109e-100
+(3 rows)
+
+QUERY: SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+three|f1 |exp_ln_f1
+-----+--------------------+---------------------
+ |1004.3 |1004.3
+ |1.2345678901234e+200|1.23456789012338e+200
+ |1.2345678901234e-200|1.23456789012339e-200
+(3 rows)
+
+QUERY: SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
+five|f1 |cbrt_f1
+----+--------------------+--------------------
+ |0 |0
+ |1004.3 |10.014312837827
+ |-34.84 |-3.26607421344208
+ |1.2345678901234e+200|4.97933859234765e+66
+ |1.2345678901234e-200|2.3112042409018e-67
+(5 rows)
+
+QUERY: SELECT '' AS five, FLOAT8_TBL.*;
+five|f1
+----+--------------------
+ |0
+ |1004.3
+ |-34.84
+ |1.2345678901234e+200
+ |1.2345678901234e-200
+(5 rows)
+
+QUERY: UPDATE FLOAT8_TBL
+ SET f1 = FLOAT8_TBL.f1 * '-1'
+ WHERE FLOAT8_TBL.f1 > '0.0';
+QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
+WARN: Bad float8 input format -- overflow
+
+QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
+WARN: Bad float8 input format -- overflow
+
+QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
+WARN:can't take log of 0!
+QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
+WARN:can't take log of a negative number
+QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
+WARN:exp() returned a floating point out of range
+
+QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
+WARN:float8div: divide by 0.0 error
+QUERY: SELECT '' AS five, FLOAT8_TBL.*;
+five|f1
+----+---------------------
+ |0
+ |-34.84
+ |-1004.3
+ |-1.2345678901234e+200
+ |-1.2345678901234e-200
+(5 rows)
+
--- /dev/null
+QUERY: CREATE TABLE INT2_TBL(f1 int2);
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('0');
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('1234');
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-1234');
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+WARN:pg_atoi: error in "34.5": can't parse ".5"
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
+WARN:pg_atoi: error reading "100000": Result too large
+QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+WARN:pg_atoi: error in "asdf": can't parse "asdf"
+QUERY: SELECT '' AS five, INT2_TBL.*;
+five| f1
+----+------
+ | 0
+ | 1234
+ | -1234
+ | 32767
+ |-32767
+(5 rows)
+
+QUERY: SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> '0'::int2;
+four| f1
+----+------
+ | 1234
+ | -1234
+ | 32767
+ |-32767
+(4 rows)
+
+QUERY: SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> '0'::int4;
+four| f1
+----+------
+ | 1234
+ | -1234
+ | 32767
+ |-32767
+(4 rows)
+
+QUERY: SELECT '' AS one, i.* FROM INT2_TBL i WHERE i.f1 = '0'::int2;
+one|f1
+---+--
+ | 0
+(1 row)
+
+QUERY: SELECT '' AS one, i.* FROM INT2_TBL i WHERE i.f1 = '0'::int4;
+one|f1
+---+--
+ | 0
+(1 row)
+
+QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 < '0'::int2;
+two| f1
+---+------
+ | -1234
+ |-32767
+(2 rows)
+
+QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 < '0'::int4;
+two| f1
+---+------
+ | -1234
+ |-32767
+(2 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 <= '0'::int2;
+three| f1
+-----+------
+ | 0
+ | -1234
+ |-32767
+(3 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 <= '0'::int4;
+three| f1
+-----+------
+ | 0
+ | -1234
+ |-32767
+(3 rows)
+
+QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > '0'::int2;
+two| f1
+---+-----
+ | 1234
+ |32767
+(2 rows)
+
+QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > '0'::int4;
+two| f1
+---+-----
+ | 1234
+ |32767
+(2 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= '0'::int2;
+three| f1
+-----+-----
+ | 0
+ | 1234
+ |32767
+(3 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= '0'::int4;
+three| f1
+-----+-----
+ | 0
+ | 1234
+ |32767
+(3 rows)
+
+QUERY: SELECT '' AS one, i.* FROM INT2_TBL i WHERE (i.f1 % '2'::int2) = '1'::int2;
+one| f1
+---+-----
+ |32767
+(1 row)
+
+QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE (i.f1 % '2'::int4) = '0'::int2;
+three| f1
+-----+-----
+ | 0
+ | 1234
+ |-1234
+(3 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int2 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+-----
+ | 0| 0
+ | 1234| 2468
+ | -1234|-2468
+ | 32767| -2
+ |-32767| 2
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int4 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+------
+ | 0| 0
+ | 1234| 2468
+ | -1234| -2468
+ | 32767| 65534
+ |-32767|-65534
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int2 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+------
+ | 0| 2
+ | 1234| 1236
+ | -1234| -1232
+ | 32767|-32767
+ |-32767|-32765
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int4 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+------
+ | 0| 2
+ | 1234| 1236
+ | -1234| -1232
+ | 32767| 32769
+ |-32767|-32765
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int2 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+-----
+ | 0| -2
+ | 1234| 1232
+ | -1234|-1236
+ | 32767|32765
+ |-32767|32767
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int4 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+------
+ | 0| -2
+ | 1234| 1232
+ | -1234| -1236
+ | 32767| 32765
+ |-32767|-32769
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int2 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+------
+ | 0| 0
+ | 1234| 617
+ | -1234| -617
+ | 32767| 16383
+ |-32767|-16383
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int4 AS x FROM INT2_TBL i;
+five| f1| x
+----+------+------
+ | 0| 0
+ | 1234| 617
+ | -1234| -617
+ | 32767| 16383
+ |-32767|-16383
+(5 rows)
+
--- /dev/null
+QUERY: CREATE TABLE INT4_TBL(f1 int4);
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('0');
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('123456');
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-123456');
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+WARN:pg_atoi: error in "34.5": can't parse ".5"
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+WARN:pg_atoi: error reading "1000000000000": Result too large
+QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+WARN:pg_atoi: error in "asdf": can't parse "asdf"
+QUERY: SELECT '' AS five, INT4_TBL.*;
+five| f1
+----+-----------
+ | 0
+ | 123456
+ | -123456
+ | 2147483647
+ |-2147483647
+(5 rows)
+
+QUERY: SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> '0'::int2;
+four| f1
+----+-----------
+ | 123456
+ | -123456
+ | 2147483647
+ |-2147483647
+(4 rows)
+
+QUERY: SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> '0'::int4;
+four| f1
+----+-----------
+ | 123456
+ | -123456
+ | 2147483647
+ |-2147483647
+(4 rows)
+
+QUERY: SELECT '' AS one, i.* FROM INT4_TBL i WHERE i.f1 = '0'::int2;
+one|f1
+---+--
+ | 0
+(1 row)
+
+QUERY: SELECT '' AS one, i.* FROM INT4_TBL i WHERE i.f1 = '0'::int4;
+one|f1
+---+--
+ | 0
+(1 row)
+
+QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 < '0'::int2;
+two| f1
+---+-----------
+ | -123456
+ |-2147483647
+(2 rows)
+
+QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 < '0'::int4;
+two| f1
+---+-----------
+ | -123456
+ |-2147483647
+(2 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 <= '0'::int2;
+three| f1
+-----+-----------
+ | 0
+ | -123456
+ |-2147483647
+(3 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 <= '0'::int4;
+three| f1
+-----+-----------
+ | 0
+ | -123456
+ |-2147483647
+(3 rows)
+
+QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > '0'::int2;
+two| f1
+---+----------
+ | 123456
+ |2147483647
+(2 rows)
+
+QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > '0'::int4;
+two| f1
+---+----------
+ | 123456
+ |2147483647
+(2 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= '0'::int2;
+three| f1
+-----+----------
+ | 0
+ | 123456
+ |2147483647
+(3 rows)
+
+QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= '0'::int4;
+three| f1
+-----+----------
+ | 0
+ | 123456
+ |2147483647
+(3 rows)
+
+QUERY: SELECT '' AS one, i.* FROM INT4_TBL i WHERE (i.f1 % '2'::int2) = '1'::int2;
+one| f1
+---+----------
+ |2147483647
+(1 row)
+
+QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE (i.f1 % '2'::int4) = '0'::int2;
+three| f1
+-----+-------
+ | 0
+ | 123456
+ |-123456
+(3 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int2 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+-------
+ | 0| 0
+ | 123456| 246912
+ | -123456|-246912
+ | 2147483647| -2
+ |-2147483647| 2
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int4 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+-------
+ | 0| 0
+ | 123456| 246912
+ | -123456|-246912
+ | 2147483647| -2
+ |-2147483647| 2
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int2 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+-----------
+ | 0| 2
+ | 123456| 123458
+ | -123456| -123454
+ | 2147483647|-2147483647
+ |-2147483647|-2147483645
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int4 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+-----------
+ | 0| 2
+ | 123456| 123458
+ | -123456| -123454
+ | 2147483647|-2147483647
+ |-2147483647|-2147483645
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int2 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+----------
+ | 0| -2
+ | 123456| 123454
+ | -123456| -123458
+ | 2147483647|2147483645
+ |-2147483647|2147483647
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int4 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+----------
+ | 0| -2
+ | 123456| 123454
+ | -123456| -123458
+ | 2147483647|2147483645
+ |-2147483647|2147483647
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int2 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+-----------
+ | 0| 0
+ | 123456| 61728
+ | -123456| -61728
+ | 2147483647| 1073741823
+ |-2147483647|-1073741823
+(5 rows)
+
+QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int4 AS x FROM INT4_TBL i;
+five| f1| x
+----+-----------+-----------
+ | 0| 0
+ | 123456| 61728
+ | -123456| -61728
+ | 2147483647| 1073741823
+ |-2147483647|-1073741823
+(5 rows)
+
+QUERY: SELECT '2'::int2 * '2'::int2 = '16'::int2 / '4'::int2 AS true;
+true
+----
+t
+(1 row)
+
+QUERY: SELECT '2'::int4 * '2'::int2 = '16'::int2 / '4'::int4 AS true;
+true
+----
+t
+(1 row)
+
+QUERY: SELECT '2'::int2 * '2'::int4 = '16'::int4 / '4'::int2 AS true;
+true
+----
+t
+(1 row)
+
+QUERY: SELECT '1000'::int4 < '999'::int4 AS false;
+false
+-----
+f
+(1 row)
+
+QUERY: SELECT 4! AS twenty_four;
+twenty_four
+-----------
+ 24
+(1 row)
+
+QUERY: SELECT !!3 AS six;
+six
+---
+ 6
+(1 row)
+
+QUERY: SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
+ten
+---
+ 10
+(1 row)
+
+QUERY: SELECT 2 + 2 / 2 AS three;
+three
+-----
+ 3
+(1 row)
+
+QUERY: SELECT (2 + 2) / 2 AS two;
+two
+---
+ 2
+(1 row)
+
+QUERY: SELECT dsqrt('64'::float8) AS eight;
+eight
+-----
+ 8
+(1 row)
+
+QUERY: SELECT |/'64'::float8 AS eight;
+eight
+-----
+ 8
+(1 row)
+
+QUERY: SELECT ||/'27'::float8 AS three;
+three
+-----
+ 3
+(1 row)
+
--- /dev/null
+QUERY: CREATE TABLE OID_TBL(f1 oid);
+QUERY: INSERT INTO OID_TBL(f1) VALUES ('1234');
+QUERY: INSERT INTO OID_TBL(f1) VALUES ('1235');
+QUERY: INSERT INTO OID_TBL(f1) VALUES ('987');
+QUERY: INSERT INTO OID_TBL(f1) VALUES ('-1040');
+QUERY: INSERT INTO OID_TBL(f1) VALUES ('');
+QUERY: INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+WARN:pg_atoi: error in "asdfasd": can't parse "asdfasd"
+QUERY: SELECT '' AS five, OID_TBL.*;
+five| f1
+----+-----
+ | 1234
+ | 1235
+ | 987
+ |-1040
+ | 0
+(5 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OID_TBL o WHERE o.f1 = '1234'::oid;
+one| f1
+---+----
+ |1234
+(1 row)
+
+QUERY: SELECT '' AS four, o.* FROM OID_TBL o WHERE o.f1 <> '1234';
+four| f1
+----+-----
+ | 1235
+ | 987
+ |-1040
+ | 0
+(4 rows)
+
+QUERY: SELECT '' AS four, o.* FROM OID_TBL o WHERE o.f1 <= '1234';
+four| f1
+----+-----
+ | 1234
+ | 987
+ |-1040
+ | 0
+(4 rows)
+
+QUERY: SELECT '' AS three, o.* FROM OID_TBL o WHERE o.f1 < '1234';
+three| f1
+-----+-----
+ | 987
+ |-1040
+ | 0
+(3 rows)
+
+QUERY: SELECT '' AS two, o.* FROM OID_TBL o WHERE o.f1 >= '1234';
+two| f1
+---+----
+ |1234
+ |1235
+(2 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OID_TBL o WHERE o.f1 > '1234';
+one| f1
+---+----
+ |1235
+(1 row)
+
--- /dev/null
+QUERY: CREATE TABLE OIDINT2_TBL(f1 oidint2);
+QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('1234/9873');
+QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('1235/9873');
+QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('987/-1234');
+QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('123456');
+QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('123456/123456');
+WARN:pg_atoi: error reading "123456": Result too large
+QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('');
+QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('asdfasd');
+WARN:pg_atoi: error in "asdfasd": can't parse "asdfasd"
+QUERY: SELECT '' AS five, OIDINT2_TBL.*;
+five|f1
+----+---------
+ |1234/9873
+ |1235/9873
+ |987/-1234
+ |123456/0
+ |0/0
+(5 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OIDINT2_TBL o WHERE o.f1 = '1235/9873';
+one|f1
+---+---------
+ |1235/9873
+(1 row)
+
+QUERY: SELECT '' AS four, o.* FROM OIDINT2_TBL o WHERE o.f1 <> '1235/9873';
+four|f1
+----+---------
+ |1234/9873
+ |987/-1234
+ |123456/0
+ |0/0
+(4 rows)
+
+QUERY: SELECT '' AS four, o.* FROM OIDINT2_TBL o WHERE o.f1 <= '1235/9873';
+four|f1
+----+---------
+ |1234/9873
+ |1235/9873
+ |987/-1234
+ |0/0
+(4 rows)
+
+QUERY: SELECT '' AS three, o.* FROM OIDINT2_TBL o WHERE o.f1 < '1235/9873';
+three|f1
+-----+---------
+ |1234/9873
+ |987/-1234
+ |0/0
+(3 rows)
+
+QUERY: SELECT '' AS two, o.* FROM OIDINT2_TBL o WHERE o.f1 >= '1235/9873';
+two|f1
+---+---------
+ |1235/9873
+ |123456/0
+(2 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OIDINT2_TBL o WHERE o.f1 > '1235/9873';
+one|f1
+---+--------
+ |123456/0
+(1 row)
+
--- /dev/null
+QUERY: CREATE TABLE OIDINT4_TBL(f1 oidint4);
+QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('1234/9873');
+QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('1235/9873');
+QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('987/-1234');
+QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('123456');
+QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('123456/1234568901234567890');
+WARN:pg_atoi: error reading "1234568901234567890": Result too large
+QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('');
+QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('asdfasd');
+WARN:pg_atoi: error in "asdfasd": can't parse "asdfasd"
+QUERY: SELECT '' AS five, OIDINT4_TBL.*;
+five|f1
+----+---------
+ |1234/9873
+ |1235/9873
+ |987/-1234
+ |123456/0
+ |0/0
+(5 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OIDINT4_TBL o WHERE o.f1 = '1235/9873';
+one|f1
+---+---------
+ |1235/9873
+(1 row)
+
+QUERY: SELECT '' AS four, o.* FROM OIDINT4_TBL o WHERE o.f1 <> '1235/9873';
+four|f1
+----+---------
+ |1234/9873
+ |987/-1234
+ |123456/0
+ |0/0
+(4 rows)
+
+QUERY: SELECT '' AS four, o.* FROM OIDINT4_TBL o WHERE o.f1 <= '1235/9873';
+four|f1
+----+---------
+ |1234/9873
+ |1235/9873
+ |987/-1234
+ |0/0
+(4 rows)
+
+QUERY: SELECT '' AS three, o.* FROM OIDINT4_TBL o WHERE o.f1 < '1235/9873';
+three|f1
+-----+---------
+ |1234/9873
+ |987/-1234
+ |0/0
+(3 rows)
+
+QUERY: SELECT '' AS two, o.* FROM OIDINT4_TBL o WHERE o.f1 >= '1235/9873';
+two|f1
+---+---------
+ |1235/9873
+ |123456/0
+(2 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OIDINT4_TBL o WHERE o.f1 > '1235/9873';
+one|f1
+---+--------
+ |123456/0
+(1 row)
+
--- /dev/null
+QUERY: CREATE TABLE OIDNAME_TBL(f1 oidname);
+QUERY: INSERT INTO OIDNAME_TBL(f1) VALUES ('1234,abcd');
+QUERY: INSERT INTO OIDNAME_TBL(f1) VALUES ('1235,efgh');
+QUERY: INSERT INTO OIDNAME_TBL(f1) VALUES ('987,XXXX');
+QUERY: INSERT INTO OIDNAME_TBL(f1) VALUES ('123456');
+WARN:Bad input data for type oidname
+QUERY: INSERT INTO OIDNAME_TBL(f1) VALUES ('123456,abcdefghijklmnopqrsutvwyz');
+QUERY: INSERT INTO OIDNAME_TBL(f1) VALUES ('');
+WARN:Bad input data for type oidname
+QUERY: INSERT INTO OIDNAME_TBL(f1) VALUES ('asdfasd');
+WARN:Bad input data for type oidname
+QUERY: SELECT '' AS four, OIDNAME_TBL.*;
+four|f1
+----+--------------------------------
+ |1234,abcd
+ |1235,efgh
+ |987,XXXX
+ |123456,abcdefghijklmnopqrsutvwyz
+(4 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OIDNAME_TBL o WHERE o.f1 = '1234,abcd';
+one|f1
+---+---------
+ |1234,abcd
+(1 row)
+
+QUERY: SELECT '' AS three, o.* FROM OIDNAME_TBL o WHERE o.f1 <> '1234,abcd';
+three|f1
+-----+--------------------------------
+ |1235,efgh
+ |987,XXXX
+ |123456,abcdefghijklmnopqrsutvwyz
+(3 rows)
+
+QUERY: SELECT '' AS two, o.* FROM OIDNAME_TBL o WHERE o.f1 <= '1234,abcd';
+two|f1
+---+---------
+ |1234,abcd
+ |987,XXXX
+(2 rows)
+
+QUERY: SELECT '' AS one, o.* FROM OIDNAME_TBL o WHERE o.f1 < '1234,abcd';
+one|f1
+---+--------
+ |987,XXXX
+(1 row)
+
+QUERY: SELECT '' AS three, o.* FROM OIDNAME_TBL o WHERE o.f1 >= '1234,abcd';
+three|f1
+-----+--------------------------------
+ |1234,abcd
+ |1235,efgh
+ |123456,abcdefghijklmnopqrsutvwyz
+(3 rows)
+
+QUERY: SELECT '' AS two, o.* FROM OIDNAME_TBL o WHERE o.f1 > '1234,abcd';
+two|f1
+---+--------------------------------
+ |1235,efgh
+ |123456,abcdefghijklmnopqrsutvwyz
+(2 rows)
+
--- /dev/null
+QUERY: CREATE TABLE POINT_TBL(f1 point);
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(0.0,0.0)');
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(-10.0,0.0)');
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(-3.0,4.0)');
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(5.1, 34.5)');
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(-5.0,-12.0)');
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('asdfasdf');
+WARN:Bad point external representation 'asdfasdf'
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('10.0,10.0');
+WARN:Bad point external representation '10.0,10.0'
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)');
+WARN:Bad point external representation '(10.0 10.0)'
+QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(10.0,10.0');
+WARN:Bad point external representation '(10.0,10.0'
+QUERY: SELECT '' AS five, POINT_TBL.*;
+five|f1
+----+----------
+ |(0,0)
+ |(-10,0)
+ |(-3,4)
+ |(5.1,34.5)
+ |(-5,-12)
+(5 rows)
+
+QUERY: SELECT '' AS three, p.* FROM POINT_TBL p WHERE p.f1 !< '(0.0, 0.0)';
+three|f1
+-----+--------
+ |(-10,0)
+ |(-3,4)
+ |(-5,-12)
+(3 rows)
+
+QUERY: SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' !> p.f1;
+three|f1
+-----+--------
+ |(-10,0)
+ |(-3,4)
+ |(-5,-12)
+(3 rows)
+
+QUERY: SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' !^ p.f1;
+one|f1
+---+--------
+ |(-5,-12)
+(1 row)
+
+QUERY: SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 !| '(0.0, 0.0)';
+one|f1
+---+--------
+ |(-5,-12)
+(1 row)
+
+QUERY: SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 =|= '(5.1, 34.5)';
+one|f1
+---+----------
+ |(5.1,34.5)
+(1 row)
+
+QUERY: SELECT '' AS two, p.* FROM POINT_TBL p
+ WHERE p.f1 ===> '(0,0,100,100)';
+two|f1
+---+----------
+ |(0,0)
+ |(5.1,34.5)
+(2 rows)
+
+QUERY: SELECT '' AS three, p.* FROM POINT_TBL p
+ WHERE not on_pb(p.f1,'(0,0,100,100)'::box);
+three|f1
+-----+--------
+ |(-10,0)
+ |(-3,4)
+ |(-5,-12)
+(3 rows)
+
+QUERY: SELECT '' AS two, p.* FROM POINT_TBL p
+ WHERE on_ppath(p.f1,'(0,3,0,0,-10,0,-10,10)'::path);
+two|f1
+---+-------
+ |(0,0)
+ |(-10,0)
+(2 rows)
+
+QUERY: SELECT '' AS five, p.f1, p.f1 <===> '(0,0)' AS dist FROM POINT_TBL p;
+five|f1 |dist
+----+----------+----
+ |(0,0) | 0
+ |(-10,0) | 10
+ |(-3,4) | 5
+ |(5.1,34.5)| 34
+ |(-5,-12) | 13
+(5 rows)
+
+QUERY: SELECT '' AS twentyfive, p1.f1, p2.f1, p1.f1 <===> p2.f1 AS dist
+ FROM POINT_TBL p1, POINT_TBL p2;
+twentyfive|f1 |f1 |dist
+----------+----------+----------+----
+ |(0,0) |(0,0) | 0
+ |(-10,0) |(0,0) | 10
+ |(-3,4) |(0,0) | 5
+ |(5.1,34.5)|(0,0) | 34
+ |(-5,-12) |(0,0) | 13
+ |(0,0) |(-10,0) | 10
+ |(-10,0) |(-10,0) | 0
+ |(-3,4) |(-10,0) | 8
+ |(5.1,34.5)|(-10,0) | 37
+ |(-5,-12) |(-10,0) | 13
+ |(0,0) |(-3,4) | 5
+ |(-10,0) |(-3,4) | 8
+ |(-3,4) |(-3,4) | 0
+ |(5.1,34.5)|(-3,4) | 31
+ |(-5,-12) |(-3,4) | 16
+ |(0,0) |(5.1,34.5)| 34
+ |(-10,0) |(5.1,34.5)| 37
+ |(-3,4) |(5.1,34.5)| 31
+ |(5.1,34.5)|(5.1,34.5)| 0
+ |(-5,-12) |(5.1,34.5)| 47
+ |(0,0) |(-5,-12) | 13
+ |(-10,0) |(-5,-12) | 13
+ |(-3,4) |(-5,-12) | 16
+ |(5.1,34.5)|(-5,-12) | 47
+ |(-5,-12) |(-5,-12) | 0
+(25 rows)
+
+QUERY: SELECT '' AS twenty, p1.f1, p2.f1
+ FROM POINT_TBL p1, POINT_TBL p2
+ WHERE (p1.f1 <===> p2.f1) > 3;
+twenty|f1 |f1
+------+----------+----------
+ |(-10,0) |(0,0)
+ |(-3,4) |(0,0)
+ |(5.1,34.5)|(0,0)
+ |(-5,-12) |(0,0)
+ |(0,0) |(-10,0)
+ |(-3,4) |(-10,0)
+ |(5.1,34.5)|(-10,0)
+ |(-5,-12) |(-10,0)
+ |(0,0) |(-3,4)
+ |(-10,0) |(-3,4)
+ |(5.1,34.5)|(-3,4)
+ |(-5,-12) |(-3,4)
+ |(0,0) |(5.1,34.5)
+ |(-10,0) |(5.1,34.5)
+ |(-3,4) |(5.1,34.5)
+ |(-5,-12) |(5.1,34.5)
+ |(0,0) |(-5,-12)
+ |(-10,0) |(-5,-12)
+ |(-3,4) |(-5,-12)
+ |(5.1,34.5)|(-5,-12)
+(20 rows)
+
+QUERY: SELECT '' AS ten, p1.f1, p2.f1
+ FROM POINT_TBL p1, POINT_TBL p2
+ WHERE (p1.f1 <===> p2.f1) > 3 and
+ p1.f1 !< p2.f1;
+ten|f1 |f1
+---+--------+----------
+ |(-10,0) |(0,0)
+ |(-3,4) |(0,0)
+ |(-5,-12)|(0,0)
+ |(-10,0) |(-3,4)
+ |(-5,-12)|(-3,4)
+ |(0,0) |(5.1,34.5)
+ |(-10,0) |(5.1,34.5)
+ |(-3,4) |(5.1,34.5)
+ |(-5,-12)|(5.1,34.5)
+ |(-10,0) |(-5,-12)
+(10 rows)
+
+QUERY: SELECT '' AS two, p1.f1, p2.f1
+ FROM POINT_TBL p1, POINT_TBL p2
+ WHERE (p1.f1 <===> p2.f1) > 3 and
+ p1.f1 !< p2.f1 and
+ p1.f1 !^ p2.f1;
+two|f1 |f1
+---+-------+--------
+ |(-3,4) |(0,0)
+ |(-10,0)|(-5,-12)
+(2 rows)
+
--- /dev/null
+QUERY: CREATE TABLE POLYGON_TBL(f1 polygon);
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(2.0,2.0,0.0,0.0,4.0,0.0)');
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(3.0,3.0,1.0,1.0,3.0,0.0)');
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,0.0)');
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,0.0,1.0,1.0)');
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('0.0');
+WARN:Bad polygon external representation '0.0'
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0 0.0');
+WARN:Bad polygon external representation '(0.0 0.0'
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2)');
+WARN:Bad polygon external representation '(0,1,2)'
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2,3');
+WARN:Bad polygon external representation '(0,1,2,3'
+QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('asdf');
+WARN:Bad polygon external representation 'asdf'
+QUERY: SELECT '' AS four, POLYGON_TBL.*;
+four|f1
+----+-------------------------------------------------------------------------------
+ |( 2, 2, 0, 0, 4, 0)
+ |( 3, 3, 1, 1, 3, 0)
+ |( 0, 0)
+ |( 0, 0, 1, 1)
+(4 rows)
+
+QUERY: SELECT '' AS three, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 && '(3.0,3.0,1.0,1.0,3.0,0.0)';
+three|f1
+-----+-------------------------------------------------------------------------------
+ |( 2, 2, 0, 0, 4, 0)
+ |( 3, 3, 1, 1, 3, 0)
+ |( 0, 0, 1, 1)
+(3 rows)
+
+QUERY: SELECT '' AS four, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 &< '(3.0,3.0,1.0,1.0,3.0,0.0)';
+four|f1
+----+-------------------------------------------------------------------------------
+ |( 2, 2, 0, 0, 4, 0)
+ |( 3, 3, 1, 1, 3, 0)
+ |( 0, 0)
+ |( 0, 0, 1, 1)
+(4 rows)
+
+QUERY: SELECT '' AS two, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 &> '(3.0,3.0,1.0,1.0,3.0,0.0)';
+two|f1
+---+-------------------------------------------------------------------------------
+ |( 2, 2, 0, 0, 4, 0)
+ |( 3, 3, 1, 1, 3, 0)
+(2 rows)
+
+QUERY: SELECT '' AS one, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 << '(3.0,3.0,1.0,1.0,3.0,0.0)';
+one|f1
+---+---------------------------
+ |( 0, 0)
+(1 row)
+
+QUERY: SELECT '' AS zero, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 >> '(3.0,3.0,1.0,1.0,3.0,0.0)';
+zero|f1
+----+--
+(0 rows)
+
+QUERY: SELECT '' AS one, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 @ '(3.0,3.0,1.0,1.0,3.0,0.0)';
+one|f1
+---+-------------------------------------------------------------------------------
+ |( 3, 3, 1, 1, 3, 0)
+(1 row)
+
+QUERY: SELECT '' AS one, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 ~= '(3.0,3.0,1.0,1.0,3.0,0.0)';
+one|f1
+---+-------------------------------------------------------------------------------
+ |( 3, 3, 1, 1, 3, 0)
+(1 row)
+
+QUERY: SELECT '' AS one, p.*
+ FROM POLYGON_TBL p
+ WHERE p.f1 ~ '(3.0,3.0,1.0,1.0,3.0,0.0)';
+one|f1
+---+-------------------------------------------------------------------------------
+ |( 3, 3, 1, 1, 3, 0)
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon << '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS false;
+false
+-----
+f
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon &< '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS true;
+true
+----
+t
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon &> '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS true;
+true
+----
+t
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon >> '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS false;
+false
+-----
+f
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon @ '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS false;
+false
+-----
+f
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon ~ '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS false;
+false
+-----
+f
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon ~= '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS false;
+false
+-----
+f
+(1 row)
+
+QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon && '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS true;
+true
+----
+t
+(1 row)
+
--- /dev/null
+QUERY: SELECT 'char 16 string'::char16 = 'char 16 string '::char16 AS false;
+false
+-----
+f
+(1 row)
+
+QUERY: SELECT 'c'::char = 'c'::char AS true;
+true
+----
+t
+(1 row)
+
+QUERY: SELECT 'this is a text string'::text = 'this is a text string'::text AS true;
+true
+----
+t
+(1 row)
+
+QUERY: SELECT 'this is a text string'::text = 'this is a text strin'::text AS false;
+false
+-----
+f
+(1 row)
+