Re: decoding BLOB's

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: decoding BLOB's
Date: 2016-02-22 19:37:39
Message-ID: 56CB6383.7070507@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/22/2016 11:23 AM, Joshua D. Drake wrote:
>> Can someone point me in the right direction per how I would remove the
>> first 25 bytes and the last 2 bytes from a bytea column?
>
> http://www.postgresql.org/docs/9.3/static/functions-binarystring.html
>
> Substring might do it for you.

won't doing it in SQL still result in a BYTEA result which will be
wrapped when dumped via COPY ?

instead, I think this needs to be done externally to sql, like by piping
the resulting file through something like ...

tail -c +25 infile.dat | head -c -2 > outfile.dat

or doing something in perl or whatever.

--
john r pierce, recycling bits in santa cruz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Seamus Abshere 2016-02-22 20:35:58 Read-only tables to avoid row visibility check
Previous Message Stephen Frost 2016-02-22 19:33:25 Re: Why does query planner choose slower BitmapAnd ?