Update and bytea problem... - Mailing list pgsql-general

From Jerry LeVan
Subject Update and bytea problem...
Date
Msg-id 2CACB69D-2F74-4A2B-A7EE-7799336F0A4C@eku.edu
Whole thread Raw
Responses Re: Update and bytea problem...
List 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


pgsql-general by date:

Previous
From: Stephan Vollmer
Date:
Subject: Re: tsearch2: How to use different configurations for two
Next
From: Michael Fuhr
Date:
Subject: Re: random delays