t
(1 row)
+SELECT 'f'::char::citext = 'f' AS t;
+ t
+---
+ t
+(1 row)
+
+SELECT 'f'::citext::char = 'f'::char AS t;
+ t
+---
+ t
+(1 row)
+
+SELECT 'f'::"char"::citext = 'f' AS t;
+ t
+---
+ t
+(1 row)
+
+SELECT 'f'::citext::"char" = 'f'::"char" AS t;
+ t
+---
+ t
+(1 row)
+
SELECT 'foo'::bytea::citext = 'foo' AS t;
t
---
t
(1 row)
-SELECT '<p>foo</p>'::xml::citext = '<p>foo</p>' AS t;
- t
----
- t
-(1 row)
-
-SELECT '<p>foo</p>'::citext::xml::text = '<p>foo</p>'::xml::text AS t;
- t
----
- t
-(1 row)
-
SELECT '1999-01-08 04:05:06'::timestamp::citext = '1999-01-08 04:05:06'::timestamp::text AS t;
t
---
text text,
varchar varchar,
bpchar bpchar,
+ char char,
+ chr "char",
name name,
bytea bytea,
boolean boolean,
cidr cidr,
inet inet,
macaddr macaddr,
- xml xml,
money money,
timestamp timestamp,
timestamptz timestamptz,
INSERT INTO caster (text) VALUES ('foo'::bpchar);
INSERT INTO caster (bpchar) VALUES ('foo'::citext);
INSERT INTO caster (citext) VALUES ('foo'::bpchar);
+INSERT INTO caster (char) VALUES ('f'::text);
+INSERT INTO caster (text) VALUES ('f'::char);
+INSERT INTO caster (char) VALUES ('f'::citext);
+INSERT INTO caster (citext) VALUES ('f'::char);
+INSERT INTO caster (chr) VALUES ('f'::text);
+INSERT INTO caster (text) VALUES ('f'::"char");
+INSERT INTO caster (chr) VALUES ('f'::citext);
+INSERT INTO caster (citext) VALUES ('f'::"char");
INSERT INTO caster (name) VALUES ('foo'::text);
INSERT INTO caster (text) VALUES ('foo'::name);
INSERT INTO caster (name) VALUES ('foo'::citext);
^
HINT: You will need to rewrite or cast the expression.
INSERT INTO caster (citext) VALUES ('08:00:2b:01:02:03'::macaddr);
--- Cannot cast to xml on assignment.
-INSERT INTO caster (xml) VALUES ('<p>foo</p>'::text);
-ERROR: column "xml" is of type xml but expression is of type text
-LINE 1: INSERT INTO caster (xml) VALUES ('<p>foo</p>'::tex...
- ^
-HINT: You will need to rewrite or cast the expression.
-INSERT INTO caster (text) VALUES ('<p>foo</p>'::xml);
-INSERT INTO caster (xml) VALUES ('<p>foo</p>'::citext);
-ERROR: column "xml" is of type xml but expression is of type citext
-LINE 1: INSERT INTO caster (xml) VALUES ('<p>foo</p>'::cit...
- ^
-HINT: You will need to rewrite or cast the expression.
-INSERT INTO caster (citext) VALUES ('<p>foo</p>'::xml);
-- Cannot cast to money on assignment.
INSERT INTO caster (money) VALUES ('12'::text);
ERROR: column "money" is of type money but expression is of type text
SELECT 'B'::citext < 'a'::text AS t; -- text wins.
t
---
- t
+ f
(1 row)
SELECT 'B'::citext <= 'a'::text AS t; -- text wins.
t
---
- t
+ f
(1 row)
SELECT 'a'::citext > 'B'::text AS t; -- text wins.
t
---
- t
+ f
(1 row)
SELECT 'a'::citext >= 'B'::text AS t; -- text wins.
t
---
- t
+ f
(1 row)
-- Test implicit casting. citext casts to varchar, but not vice-versa.
SELECT 'B'::citext < 'a'::varchar AS t; -- varchar wins.
t
---
- t
+ f
(1 row)
SELECT 'B'::citext <= 'a'::varchar AS t; -- varchar wins.
t
---
- t
+ f
(1 row)
SELECT 'a'::citext > 'B'::varchar AS t; -- varchar wins.
t
---
- t
+ f
(1 row)
SELECT 'a'::citext >= 'B'::varchar AS t; -- varchar wins.
t
---
- t
+ f
(1 row)
-- A couple of longer examlpes to ensure that we don't get any issues with bad
t
(1 row)
+SELECT 'f'::char::citext = 'f' AS t;
+ t
+---
+ t
+(1 row)
+
+SELECT 'f'::citext::char = 'f'::char AS t;
+ t
+---
+ t
+(1 row)
+
+SELECT 'f'::"char"::citext = 'f' AS t;
+ t
+---
+ t
+(1 row)
+
+SELECT 'f'::citext::"char" = 'f'::"char" AS t;
+ t
+---
+ t
+(1 row)
+
SELECT 'foo'::bytea::citext = 'foo' AS t;
t
---
t
(1 row)
-SELECT '<p>foo</p>'::xml::citext = '<p>foo</p>' AS t;
-ERROR: unsupported XML feature
-LINE 1: SELECT '<p>foo</p>'::xml::citext = '<p>foo</p>' AS t;
- ^
-DETAIL: This functionality requires the server to be built with libxml support.
-HINT: You need to rebuild PostgreSQL using --with-libxml.
-SELECT '<p>foo</p>'::citext::xml::text = '<p>foo</p>'::xml::text AS t;
-ERROR: unsupported XML feature
-LINE 1: SELECT '<p>foo</p>'::citext::xml::text = '<p>foo</p>'::xml::...
- ^
-DETAIL: This functionality requires the server to be built with libxml support.
-HINT: You need to rebuild PostgreSQL using --with-libxml.
SELECT '1999-01-08 04:05:06'::timestamp::citext = '1999-01-08 04:05:06'::timestamp::text AS t;
t
---
text text,
varchar varchar,
bpchar bpchar,
+ char char,
+ chr "char",
name name,
bytea bytea,
boolean boolean,
cidr cidr,
inet inet,
macaddr macaddr,
- xml xml,
money money,
timestamp timestamp,
timestamptz timestamptz,
INSERT INTO caster (text) VALUES ('foo'::bpchar);
INSERT INTO caster (bpchar) VALUES ('foo'::citext);
INSERT INTO caster (citext) VALUES ('foo'::bpchar);
+INSERT INTO caster (char) VALUES ('f'::text);
+INSERT INTO caster (text) VALUES ('f'::char);
+INSERT INTO caster (char) VALUES ('f'::citext);
+INSERT INTO caster (citext) VALUES ('f'::char);
+INSERT INTO caster (chr) VALUES ('f'::text);
+INSERT INTO caster (text) VALUES ('f'::"char");
+INSERT INTO caster (chr) VALUES ('f'::citext);
+INSERT INTO caster (citext) VALUES ('f'::"char");
INSERT INTO caster (name) VALUES ('foo'::text);
INSERT INTO caster (text) VALUES ('foo'::name);
INSERT INTO caster (name) VALUES ('foo'::citext);
^
HINT: You will need to rewrite or cast the expression.
INSERT INTO caster (citext) VALUES ('08:00:2b:01:02:03'::macaddr);
--- Cannot cast to xml on assignment.
-INSERT INTO caster (xml) VALUES ('<p>foo</p>'::text);
-ERROR: column "xml" is of type xml but expression is of type text
-LINE 1: INSERT INTO caster (xml) VALUES ('<p>foo</p>'::tex...
- ^
-HINT: You will need to rewrite or cast the expression.
-INSERT INTO caster (text) VALUES ('<p>foo</p>'::xml);
-ERROR: unsupported XML feature
-LINE 1: INSERT INTO caster (text) VALUES ('<p>foo</p>'::xml...
- ^
-DETAIL: This functionality requires the server to be built with libxml support.
-HINT: You need to rebuild PostgreSQL using --with-libxml.
-INSERT INTO caster (xml) VALUES ('<p>foo</p>'::citext);
-ERROR: column "xml" is of type xml but expression is of type citext
-LINE 1: INSERT INTO caster (xml) VALUES ('<p>foo</p>'::cit...
- ^
-HINT: You will need to rewrite or cast the expression.
-INSERT INTO caster (citext) VALUES ('<p>foo</p>'::xml);
-ERROR: unsupported XML feature
-LINE 1: INSERT INTO caster (citext) VALUES ('<p>foo</p>'::xml...
- ^
-DETAIL: This functionality requires the server to be built with libxml support.
-HINT: You need to rebuild PostgreSQL using --with-libxml.
-- Cannot cast to money on assignment.
INSERT INTO caster (money) VALUES ('12'::text);
ERROR: column "money" is of type money but expression is of type text
SELECT 'foo'::name::citext = 'foo' AS t;
SELECT 'foo'::citext::name = 'foo'::name AS t;
+SELECT 'f'::char::citext = 'f' AS t;
+SELECT 'f'::citext::char = 'f'::char AS t;
+
+SELECT 'f'::"char"::citext = 'f' AS t;
+SELECT 'f'::citext::"char" = 'f'::"char" AS t;
+
SELECT 'foo'::bytea::citext = 'foo' AS t;
SELECT 'foo'::citext::bytea = 'foo'::bytea AS t;
SELECT '08:00:2b:01:02:03'::macaddr::citext = '08:00:2b:01:02:03' AS t;
SELECT '08:00:2b:01:02:03'::citext::macaddr = '08:00:2b:01:02:03'::macaddr AS t;
-SELECT '<p>foo</p>'::xml::citext = '<p>foo</p>' AS t;
-SELECT '<p>foo</p>'::citext::xml::text = '<p>foo</p>'::xml::text AS t;
-
SELECT '1999-01-08 04:05:06'::timestamp::citext = '1999-01-08 04:05:06'::timestamp::text AS t;
SELECT '1999-01-08 04:05:06'::citext::timestamp = '1999-01-08 04:05:06'::timestamp AS t;
SELECT '1999-01-08 04:05:06'::timestamptz::citext = '1999-01-08 04:05:06'::timestamptz::text AS t;
text text,
varchar varchar,
bpchar bpchar,
+ char char,
+ chr "char",
name name,
bytea bytea,
boolean boolean,
cidr cidr,
inet inet,
macaddr macaddr,
- xml xml,
money money,
timestamp timestamp,
timestamptz timestamptz,
INSERT INTO caster (bpchar) VALUES ('foo'::citext);
INSERT INTO caster (citext) VALUES ('foo'::bpchar);
+INSERT INTO caster (char) VALUES ('f'::text);
+INSERT INTO caster (text) VALUES ('f'::char);
+INSERT INTO caster (char) VALUES ('f'::citext);
+INSERT INTO caster (citext) VALUES ('f'::char);
+
+INSERT INTO caster (chr) VALUES ('f'::text);
+INSERT INTO caster (text) VALUES ('f'::"char");
+INSERT INTO caster (chr) VALUES ('f'::citext);
+INSERT INTO caster (citext) VALUES ('f'::"char");
+
INSERT INTO caster (name) VALUES ('foo'::text);
INSERT INTO caster (text) VALUES ('foo'::name);
INSERT INTO caster (name) VALUES ('foo'::citext);
INSERT INTO caster (macaddr) VALUES ('08:00:2b:01:02:03'::citext);
INSERT INTO caster (citext) VALUES ('08:00:2b:01:02:03'::macaddr);
--- Cannot cast to xml on assignment.
-INSERT INTO caster (xml) VALUES ('<p>foo</p>'::text);
-INSERT INTO caster (text) VALUES ('<p>foo</p>'::xml);
-INSERT INTO caster (xml) VALUES ('<p>foo</p>'::citext);
-INSERT INTO caster (citext) VALUES ('<p>foo</p>'::xml);
-
-- Cannot cast to money on assignment.
INSERT INTO caster (money) VALUES ('12'::text);
INSERT INTO caster (text) VALUES ('12'::money);