Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 4B3B961AFBE for ; Fri, 20 Jan 2012 15:26:09 -0400 (AST) Received: from mail63.csoft.net ([205.205.214.4]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RoK6A-0002oa-H1 for pgsql-jdbc@postgresql.org; Fri, 20 Jan 2012 19:26:08 +0000 Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 360A22840A; Fri, 20 Jan 2012 14:25:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=u698zDR9ekKZ/LE9TSw7ULOrEFw=; b=bLMIXF Mekd7Uoz1ZfaThqMpfCfNPnSjbdS+jNYy36Qg8oa/+1Ug4CRGw6bCH3R0tQ+MxLS f7w5B4L7OShuNqsqYOc6Sn7pbFB4OZ9y/dNTRabZE9nhD/Xyb5UhAX63LJaZjuoN XfVhyvrT84lhQKGxlFIGxRws/WYAwP49CaxuQ= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id EB62828404; Fri, 20 Jan 2012 14:25:52 -0500 (EST) Received: by leary.csoft.net (Postfix, from userid 1112) id C8AD9A24F; Fri, 20 Jan 2012 14:25:52 -0500 (EST) Date: Fri, 20 Jan 2012 14:25:52 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: =?KOI8-R?B?8s/Nwc4g7MnUz9fexc7Lzw==?= cc: pgsql-jdbc@postgresql.org, Florent Guillaume , polobo@yahoo.com Subject: Re: plpgsql function, comment with single quote, braces In-Reply-To: Message-ID: References: <011b01ccd630$c00a3350$401e99f0$@yahoo.com> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/66 X-Sequence-Number: 22606 On Fri, 20 Jan 2012, ????? ?????????? wrote: > [simple example code] > > What about these? > Yes, this is a bug. The escape processor is getting confused about what it should process and is incorrectly modifying your code. Escape processing should only occur in a raw SQL, never within a literal value. The escape processor should skip over the entire function body because it is within dollar quotes and is a literal, but it doesn't understand dollar quotes so it is examining the contents and is getting further confused by the single quotes within it. The parameter locating code (looking for ?) knows about dollar quotes, so it would be nice to unify with that instead of having two partial query parsers. Kris Jurka