Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 97FC6636AD5 for ; Thu, 11 Mar 2010 14:49:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 46100-08-2 for ; Thu, 11 Mar 2010 18:48:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.pcl-ipout01.plus.net (relay.pcl-ipout01.plus.net [212.159.7.99]) by mail.postgresql.org (Postfix) with ESMTP id 8F4396370E2 for ; Thu, 11 Mar 2010 14:00:06 -0400 (AST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAKu+mEvUOFPl/2dsb2JhbACaYXO9VoR7BA Received: from plesk-mail01.plus.net ([212.56.83.229]) by relay.pcl-ipout01.plus.net with ESMTP; 11 Mar 2010 18:00:05 +0000 Received: (qmail 25468 invoked from network); 11 Mar 2010 18:00:04 +0000 Received: from host86-142-60-221.range86-142.btcentralplus.com (HELO osiris.mauzo.dyndns.org) (86.142.60.221) by plesk-mail01.plus.net with SMTP; 11 Mar 2010 18:00:03 +0000 Received: (qmail 54662 invoked by uid 1001); 11 Mar 2010 18:00:02 -0000 Date: Thu, 11 Mar 2010 18:00:02 +0000 From: Ben Morrow To: dennis.mails@gmail.com, pgsql-sql@postgresql.org Subject: Re: Help : insert a bytea data into new table Message-ID: <20100311180002.GA54548@osiris.mauzo.dyndns.org> References: <20100309034626.GA12083@osiris.mauzo.dyndns.org> <20100309111410.GA15752@osiris.mauzo.dyndns.org> <20100310152510.GA37991@osiris.mauzo.dyndns.org> <20100311114648.GA50794@osiris.mauzo.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Newsgroups: pgsql.sql Organization: Who, me? User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.185 tagged_above=-10 required=5 tests=BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 201003/62 X-Sequence-Number: 33769 [quoting fixed] Quoth dennis : > Ben Morrow wrote: > > Quoth dennis: > >> 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