Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A73019FB556 for ; Tue, 15 May 2007 04:13:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 46003-06 for ; Tue, 15 May 2007 04:12:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 326829FB660 for ; Tue, 15 May 2007 04:12:58 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 2A9EE76B0F; Tue, 15 May 2007 08:12:56 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id F2EE1274136; Tue, 15 May 2007 08:12:55 +0100 (BST) Message-ID: <46495D77.6050108@archonet.com> Date: Tue, 15 May 2007 08:12:55 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Nemo Terry Cc: pgsql-sql@postgresql.org Subject: Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...) References: In-Reply-To: Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/119 X-Sequence-Number: 28399 Nemo Terry wrote: > But I must use it in function,so... > Do you have another solution? >>> because obj_name from another table has value like this:S'pore High >>> Polymer. >>> Following error raises: >>> ERROR: syntax error at or near "pore" You'll want to look into the quote_ident() and quote_literal() functions when constructing queries like this. See functions and operators / string functions for details. -- Richard Huxton Archonet Ltd