On Fri, Jun 06, 2014 at 10:30:56AM -0400, Tom Lane wrote:
> It's possible that what you are looking for is a binary-equivalent
> cast from text to bytea, which you could create like this:
> # create cast (text as bytea) without function;
Hm. No, actually it does not help. But playing around with
Stefan Froehlich writes:
> ... Casting the result does not work either:
> # select encode(encode(column, 'escape')::bytea, 'escape')
> because the cast reverts the effect of the first encode(), so the result
> does not change.
Since there's no explicitly defined cast from text to bytea accordin
> > # select encode(encode(column, 'escape'), 'escape')
> Any chance you can encode() into temp table then encode() the result.
Don't think so, PostgreSQL will recognize the temp column either as text
or as bytea and then refuse either the insert or the encode() because of
a type mismatch.
An
Sent from my iPhone
> On Jun 6, 2014, at 7:00 AM, Stefan Froehlich
> wrote:
>
> In one of my databases, I have mistakenly double encoded bytea
> values (i.e. the content is literally '\x202020...' which would have
> to be decoded once more to get the actually desired content).
>
> But how to
In one of my databases, I have mistakenly double encoded bytea
values (i.e. the content is literally '\x202020...' which would have
to be decoded once more to get the actually desired content).
But how to get to the content? This:
# select encode(column, 'escape')
gives me the once-only encoded