Update and bytea problem...

From: Jerry LeVan <jerry(dot)levan(at)eku(dot)edu>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Update and bytea problem...
Date: 2005-12-10 01:46:17
Message-ID: 2CACB69D-2F74-4A2B-A7EE-7799336F0A4C@eku.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am trying to write a general update command where
there might be "bytea" fields involved.

The update command is generated programatically.

I am having some problems when a bytea field is
involved.

A generated command might look like:

update pics set info='moof.jpg', byteafield='<pgescaped contents of
moof.jpg>'
where info='doofus.jpg' and byteafield = '<pgescaped contents of
doofus.jpg>'

Unfortunately the above does not seem to work, I keep getting a
syntax error
with an invalid character '\' generally thousands of bytes into the
command.

Does update play nice with bytea used as above ( the escaped contents
of doofus.jpg
are the results of fetching the byteafield as text...)?

For a couple of reasons ( NULL and DEFAULT) I have to use a text
interface.

Thanks

Jerry

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-12-10 01:52:16 Re: random delays
Previous Message Stephan Vollmer 2005-12-09 23:10:22 Re: tsearch2: How to use different configurations for two