In which good intentions are punished, take 2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: In which good intentions are punished, take 2
Date: 2014-02-26 00:36:04
Message-ID: 4309.1393374964@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Since I committed 49c817eab78c6f0ce8c3bf46766b73d6cf3190b7 to make
pg_do_encoding_conversion not fail silently, buildfarm member magpie
has been whining:
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=magpie&dt=2014-02-25%2011%3A00%3A08

To wit, that if you run contrib/citext's regression tests in a
LATIN2-encoded database, you get this:

SELECT convert_to( name, 'ISO-8859-1' ) = convert_to( name::text, 'ISO-8859-1' ) AS t FROM srt;
! ERROR: default conversion function for encoding "LATIN2" to "LATIN1" does not exist

Well, it's right, there is no such conversion function. A quick look
in the buildfarm logs for older runs confirms that previously, all
we were getting was the useless LOG bleats that the previous coding
emitted:

LOG: default conversion function for encoding "LATIN2" to "LATIN1" does not exist
STATEMENT: SELECT convert_to( name, 'ISO-8859-1' ) = convert_to( name::text, 'ISO-8859-1' ) AS t FROM srt;

That didn't appear in the user-visible output, allowing the regression
test to appear to "pass" although under no circumstances could it be
argued that what was happening was sane.

We could possibly replace this test case with

SELECT convert_from( name::bytea, 'SQL_ASCII' ) = convert_from( name::text::bytea, 'SQL_ASCII' ) AS t FROM srt;

though I'm not sure I see the point: whatever you might think this
statement is testing, it's not got much to do with citext. On the
other hand, we evidently have got precious little other buildfarm
coverage of the convert() family of functions, so maybe removing
this test altogether wouldn't be the best thing either.

Thoughts?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-02-26 00:42:56 Re: pg_dumpall reccomendation in release notes
Previous Message Bruce Momjian 2014-02-26 00:28:46 Re: Bit data type header reduction in some cases