In PostgreSQL9.6, the test opr_sanity from server regression suite has added following validations for the System Catalog pg_conversion.
SELECT p1.oid, p1.conname
FROM pg_conversion as p1
WHERE condefault AND
convert('ABC'::bytea, pg_encoding_to_char(conforencoding),
pg_encoding_to_char(contoencoding)) != 'ABC';
It looks like this validation might not reflect the correct behaviour for a well defined conproc for certain encodings.
e.g. Consider LATIN1 as src_encoding and EBCDIC as dst_encoding in the above query. Now the convert() result for this should be:
select convert('ABC'::bytea,'LATIN1','EBCDIC');
convert
----------
\xc1c2c3
The resultant hex value above(which is the actual EBCDIC code for 'ABC') is not same as ASCII hex value for 'ABC'. Hence the validation query from opr_sanity would show this conproc in the output indicating that the conproc is not well defined. This does not seem correct.
Please let me know if this understanding is correct. If it is, then the validation test should indicate that the specific conversion is a valid conversion.