1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Add some more citext test cases, per David Wheeler. Also remove the

citext-to-and-from-xml tests, since those caused variation between
installations with or without libxml without really proving much.  Instead
repurpose citext_1.out as the expected results in glibc en_US (and probably
other) locales.
This commit is contained in:
Tom Lane
2008-11-07 23:17:30 +00:00
parent 399ad77c66
commit 13fdd0e4d1
3 changed files with 94 additions and 80 deletions

View File

@ -220,6 +220,12 @@ SELECT '4.0'::citext::float8 = 4.0 AS t;
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;
@ -244,9 +250,6 @@ SELECT '192.168.100.128'::citext::inet = '192.168.100.128'::inet 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;
@ -300,6 +303,8 @@ CREATE TABLE caster (
text text,
varchar varchar,
bpchar bpchar,
char char,
chr "char",
name name,
bytea bytea,
boolean boolean,
@ -312,7 +317,6 @@ CREATE TABLE caster (
cidr cidr,
inet inet,
macaddr macaddr,
xml xml,
money money,
timestamp timestamp,
timestamptz timestamptz,
@ -346,6 +350,16 @@ 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);
@ -417,12 +431,6 @@ INSERT INTO caster (text) VALUES ('08:00:2b:01:02:03'::macaddr);
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);