diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-02-27 14:58:47 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-02-27 14:58:47 -0500 |
commit | 1161d895d826950cbb736e5872935f3f53cc2e27 (patch) | |
tree | ecb5c83d1425b4c78c5a423b8a433ec682583305 | |
parent | 4333eee82d399df8f724faa331827dcfae1fdf28 (diff) | |
download | postgresql-1161d895d826950cbb736e5872935f3f53cc2e27.tar.gz postgresql-1161d895d826950cbb736e5872935f3f53cc2e27.zip |
Remove dependency on database encoding in citext regression test.
Testing convert_to(..., 'ISO-8859-1') fails if there isn't a conversion
function available from the database encoding to ISO-8859-1. This has
been broken since day one, but the breakage was hidden by
pg_do_encoding_conversion's failure to complain, up till commit
49c817eab78c6f0ce8c3bf46766b73d6cf3190b7.
Since the data being converted in this test is plain ASCII, no actual
conversion need happen (and if it did, it would prove little about citext
anyway). So that we still have some code coverage of the convert() family
of functions, let's switch to using convert_from, with SQL_ASCII as the
specified source encoding. Per buildfarm.
-rw-r--r-- | contrib/citext/expected/citext.out | 2 | ||||
-rw-r--r-- | contrib/citext/expected/citext_1.out | 2 | ||||
-rw-r--r-- | contrib/citext/sql/citext.sql | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/contrib/citext/expected/citext.out b/contrib/citext/expected/citext.out index fea4bcbb1eb..411b689b4b9 100644 --- a/contrib/citext/expected/citext.out +++ b/contrib/citext/expected/citext.out @@ -1691,7 +1691,7 @@ SELECT btrim('xyxtrimyyx'::citext, 'xy'::text ) = 'trim' AS t; -- chr() takes an int and returns text. -- convert() and convert_from take bytea and return text. -SELECT convert_to( name, 'ISO-8859-1' ) = convert_to( name::text, 'ISO-8859-1' ) AS t FROM srt; +SELECT convert_from( name::bytea, 'SQL_ASCII' ) = convert_from( name::text::bytea, 'SQL_ASCII' ) AS t FROM srt; t --- t diff --git a/contrib/citext/expected/citext_1.out b/contrib/citext/expected/citext_1.out index 101f10526ea..da3862f49ba 100644 --- a/contrib/citext/expected/citext_1.out +++ b/contrib/citext/expected/citext_1.out @@ -1691,7 +1691,7 @@ SELECT btrim('xyxtrimyyx'::citext, 'xy'::text ) = 'trim' AS t; -- chr() takes an int and returns text. -- convert() and convert_from take bytea and return text. -SELECT convert_to( name, 'ISO-8859-1' ) = convert_to( name::text, 'ISO-8859-1' ) AS t FROM srt; +SELECT convert_from( name::bytea, 'SQL_ASCII' ) = convert_from( name::text::bytea, 'SQL_ASCII' ) AS t FROM srt; t --- t diff --git a/contrib/citext/sql/citext.sql b/contrib/citext/sql/citext.sql index 8a3532bea59..27678fab5df 100644 --- a/contrib/citext/sql/citext.sql +++ b/contrib/citext/sql/citext.sql @@ -572,7 +572,7 @@ SELECT btrim('xyxtrimyyx'::citext, 'xy'::text ) = 'trim' AS t; -- chr() takes an int and returns text. -- convert() and convert_from take bytea and return text. -SELECT convert_to( name, 'ISO-8859-1' ) = convert_to( name::text, 'ISO-8859-1' ) AS t FROM srt; +SELECT convert_from( name::bytea, 'SQL_ASCII' ) = convert_from( name::text::bytea, 'SQL_ASCII' ) AS t FROM srt; SELECT decode('MTIzAAE='::citext, 'base64') = decode('MTIzAAE='::text, 'base64') AS t; -- encode() takes bytea and returns text. SELECT initcap('hi THOMAS'::citext) = initcap('hi THOMAS'::text) AS t; |