Inserting exported bytea value

From: seiliki(at)so-net(dot)net(dot)tw
To: pgsql-general(at)postgresql(dot)org
Subject: Inserting exported bytea value
Date: 2010-02-11 12:15:00
Message-ID: 20100211121507.6EC5DF48063@m5.so-net.net.tw
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to build SQL commands that insert values exported from a bytea column. Output facilities do not escape single quotes for bytea column. As such, the built INSERT SQL can be invalid because single quotes can appear in values. For example, the built (invalid) INSERT SQL command can look like this:

INSERT INTO t1 VALUES ('ABC\\000C'DE');

Note the apostrophe between C and D.

Are there straight approaches to do this job using version 8.x?
Does the bytea hex export feature provided by version 9 help solve this problem?

Thank you in advance!

CN

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2010-02-11 12:27:53 Re: Inserting exported bytea value
Previous Message db.subscriptions 2010-02-11 11:36:48 Re: PostgreSQL Installation