Re: BUG #5092: to_ascii(); ascii() don't work with bytea - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #5092: to_ascii(); ascii() don't work with bytea
Date
Msg-id 1254470093.10783.3.camel@fsopti579.F-Secure.com
Whole thread Raw
In response to BUG #5092: to_ascii(); ascii() don't work with bytea  ("Dan French" <Bomarc_com@yahoo.com>)
List pgsql-bugs
On Fri, 2009-10-02 at 02:17 +0000, Dan French wrote:
> #1: bytea_string = '"0"'  (table; bytea)
> Function:
>    trim('"' both from bytea_string)
>  fails and returns: '"0'

Works for me.  Please submit a complete test case.

> #2: Come on folks:  Bytea is a series of bytes.  Conversion to ASCII is not
> this difficult; and should (does) not require explicit type casts (esp since
> they are already in ASCII)

Converting between data types that have different semantics should
always requires an explicit cast.  This is to protect against accidental
misinterpretation.  There is ample discussion about that in the
archives.

pgsql-bugs by date:

Previous
From: "Dan French"
Date:
Subject: BUG #5092: to_ascii(); ascii() don't work with bytea
Next
From: "Akira Kurosawa"
Date:
Subject: BUG #5095: pg_statio_xxx_sequences does not work