Vlad Romascanu writes:
> Hi, Tom,
> Why does:
>CREATE CAST (text AS bytea) WITHOUT FUNCTION;
>SELECT E'C:\\something'::text::bytea;
> work as expected, but (with the original text->bytea cast in place):
>CREATE DOMAIN my_varlena AS text;
>CREATE CAST (my_varlena AS bytea) WITHOU
Hi, Tom,
Why does:
CREATE CAST (text AS bytea) WITHOUT FUNCTION;
SELECT E'C:\\something'::text::bytea;
work as expected, but (with the original text->bytea cast in place):
CREATE DOMAIN my_varlena AS text;
CREATE CAST (my_varlena AS bytea) WITHOUT FUNCTION;
SELECT E'C:\\something
Bruce Momjian writes:
> Vlad Romascanu wrote:
>> Is there any way of casting (reinterpreting) a varchar/text field
>> containing arbitrary backslashes to bytea without making an escaped
>> copy of the varchar/text first?
> Well, the '\\' is being converted to '\' because of the single-quotes,
> a
Hi, Bruce,
Yes, I essentially want to reinterpret text as bytea without any
conversion or actual backslash logic coming in the process, in the
same way pg_convert_from internally reinterprets the bytea return
value from pg_convert as text without any additional logic. I.e.
given the text field 'C
Vlad Romascanu wrote:
> Hello,
>
> Is there any way of casting (reinterpreting) a varchar/text field
> containing arbitrary backslashes to bytea without making an escaped
> copy of the varchar/text first? In the examples below I am using a
> constant E'...' for clarity, the value normally comes f