[quoting fixed]
Quoth dennis <[email protected]>:
> Ben Morrow wrote:
> > Quoth dennis<[email protected]>:
> >> Dear Ben
> >>
> >> thanks for you anwser.
> >> I try to add function quote_literal on my sql statement .
> >>
> >> but it raise other error message (quote_literal not support bytea format):
> >> function quote_literal(bytea) does not exist
> >
> > Which Postgres version are you using?
>
> Postgres : 8.1.4
Then I think you want
create function quote_literal (bytea)
returns text
immutable strict
language plpgsql
as $$
begin
return 'E'''
|| replace(encode($1, 'escape'), E'\\', E'\\\\')
|| '''';
end;
$$;
Ben
--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql