[quoting fixed]

Quoth dennis <dennis.ma...@gmail.com>:
> Ben Morrow wrote:
> > Quoth dennis<den...@teltel.com>:
> >> 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 (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to