Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 674DB1337B34 for ; Tue, 22 Feb 2011 17:19:14 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 14709-02 for ; Tue, 22 Feb 2011 21:19:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f46.google.com (mail-bw0-f46.google.com [209.85.214.46]) by mail.postgresql.org (Postfix) with ESMTP id 03EE6133740B for ; Tue, 22 Feb 2011 17:19:05 -0400 (AST) Received: by bwz15 with SMTP id 15so2756205bwz.33 for ; Tue, 22 Feb 2011 13:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:reply-to:to:subject:date:user-agent:cc :references:in-reply-to:x-kmail-markup:mime-version:content-type :content-transfer-encoding:message-id; bh=alMMfmysDXcp7PL6hpUyg4Cq/+mCmugJWyjSfT5BT9A=; b=rE10lllC68swvdKE3iPhq19Akb/+Fbus1k/X2KFYZQvtbB7I9Ff/RAItifKebHldt1 iujvIFHxOVAIVQD3s9/33JfCEl7CvQINoqOSdHt2MMT0wQ+B9n+WgFtGctT0m/zn2RfE wNXxhAfNbZAZ2Cm1f8ux5X7yrtviw2WsiFM7s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :x-kmail-markup:mime-version:content-type:content-transfer-encoding :message-id; b=MhL7KUCVIeZIF6cjlPriZFrbIw8catM4BDDKBi/nKjxN5lcB3GSKwxMb0v3FYzuf/M DFfRLBbVUVeS/Pqgpx+7a/9b+dMyMjsH2nT34fa7VMsXvElbdbH1TufZwmCkjeUji/dL I9Q7XIZKYhcR//ebH8olYkuqsLBa1bEZ77vtk= Received: by 10.204.138.130 with SMTP id a2mr2922062bku.211.1298409543158; Tue, 22 Feb 2011 13:19:03 -0800 (PST) Received: from tucker.localnet (c-24-17-164-54.hsd1.wa.comcast.net [24.17.164.54]) by mx.google.com with ESMTPS id l3sm2117996fan.0.2011.02.22.13.19.00 (version=SSLv3 cipher=OTHER); Tue, 22 Feb 2011 13:19:01 -0800 (PST) From: Adrian Klaver Reply-To: adrian.klaver@gmail.com To: pgsql-sql@postgresql.org Subject: Re: quotes etc Date: Tue, 22 Feb 2011 13:18:56 -0800 User-Agent: KMail/1.13.5 (Linux/2.6.32-28-generic; KDE/4.4.5; i686; ; ) Cc: John Fabiani References: <201102221226.41317.johnf@jfcomputer.com> In-Reply-To: <201102221226.41317.johnf@jfcomputer.com> X-KMail-Markup: true MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary-01=_AhCZNTBMC3YFTM1" Content-Transfer-Encoding: 7bit Message-Id: <201102221318.56516.adrian.klaver@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.588 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201102/111 X-Sequence-Number: 35187 --Boundary-01=_AhCZNTBMC3YFTM1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit On Tuesday, February 22, 2011 12:26:41 pm John Fabiani wrote: > Hi, > I would have thought that there would be a simple built-in function that > would escape the quotes as ('D' Andes') to ('D\' Andes'). But I did not > see anything? > > I am I wrong? > > Johnf Dollar quoting ? : http://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html 4.1.2.4. Dollar-Quoted String Constants test(5432)aklaver=>SELECT $$D' Andes$$; ?column? ---------- D' Andes -- Adrian Klaver adrian.klaver@gmail.com --Boundary-01=_AhCZNTBMC3YFTM1 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit

On Tuesday, February 22, 2011 12:26:41 pm John Fabiani wrote:

> Hi,

> I would have thought that there would be a simple built-in function that

> would escape the quotes as ('D' Andes') to ('D\' Andes'). But I did not

> see anything?

>

> I am I wrong?

>

> Johnf

Dollar quoting ? :

http://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html

4.1.2.4. Dollar-Quoted String Constants

test(5432)aklaver=>SELECT $$D' Andes$$;

?column?

----------

D' Andes

--

Adrian Klaver

adrian.klaver@gmail.com

--Boundary-01=_AhCZNTBMC3YFTM1--