Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGAut-00083u-OP for pgsql-jdbc@postgresql.org; Mon, 24 Sep 2012 15:49:51 +0000 Received: from smtp102.prem.mail.ac4.yahoo.com ([76.13.13.41]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TGAur-0001tp-7A for pgsql-jdbc@postgresql.org; Mon, 24 Sep 2012 15:49:51 +0000 Received: (qmail 15266 invoked from network); 24 Sep 2012 15:49:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=SoGbntC0bJzklDFMpGgC6CktJW0cSN9ZL95zm9eGQl7SThi+5oClm8mgvhCy/LU14IxTyISTREfpy9/pAT5PJl7YVfJi789thIx+9BcVHgOtnfYUMqRFVwhPNN7IzrR8UkJhrKLm2g67P8suU7yVoVYpVzFGeCl8vKuwOrN7QXU= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1348501787; bh=Bt23FCXyRHUCMQ4EuaQ/s4hFBXGLUB/sHmcqyjYQQrA=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=6p0OgBenMDvCEMvAR3qLmNyoqHeZu68K7/++cvD4KYOrd687h53zFRmLb8/aaOc0LBM6cDlEPMi95nQBOm+6MJuIQ37DqOjqGk2DdjFWJSitta1fFOyPwlU4B75P73yupqUON7Kd/n6tYIdp0D4AKhfbsw3kF/lCvzYBKVGXDbA= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: fHNB7n0VM1lS_y9lOfs6bUZnIevKJoAhlYoAOnxsbtc1e_k BRHouxmJcQL6qxQT2_vI1gzZ2h0boTcsiCWSWFTiSwfG3XayMhWCpw7XwER8 idzdd3_XJdpHFLsYzs_HV5lUaDaPk8NT19_cx1WuJfOwWnjJVrpQ9DdHFTOK nFkjAhn10Tbx44ZXjod0nBaEQbFgMOIlg4NPWe2n_AAmH5xOhTuWt6CUAhjm VKCwW31T7sdkjS99dCPFRdiW_X0u0fmUEzyO8Rokbwy9QSV1.h80j92zoG6x vHpDrj00BlS_sYI8iS.7JKTXZcVcJcex8NjqG6vjvHgj_VXFKlufMAjltOAa Zg4C5W3zSVN.JQpoUK2N8Byp2BWxQHSg7ZLH.xYNu9.V3Jr3uyVaLxNXf5kl bZLm3vtU24NG4ODIh1fFKMdX9H3dc12YIbAl3 X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from WolfDog (polobo@24.93.23.188 with login) by smtp102.prem.mail.ac4.yahoo.com with SMTP; 24 Sep 2012 15:49:47 +0000 UTC From: "David Johnston" To: "'GEISINGER Marc - Contractor'" , "'Dave Cramer'" Cc: References: <31630_1348140231_505AFCC7_31630_19463_1_E4DFA2E3210FA443B032684B39D16BB4092FB05DA1@THSNCOA06MXS02P.ONE-06.GRP> <20900_1348212583_505C1767_20900_6851_1_E4DFA2E3210FA443B032684B39D16BB4092FB06168@THSNCOA06MXS02P.ONE-06.GRP> <012501cd9815$42b55e50$c8201af0$@yahoo.com> <012c01cd9818$1ca45060$55ecf120$@yahoo.com> <6830_1348470710_506007B6_6830_1428_1_E4DFA2E3210FA443B032684B39D16BB4092FB065BE@THSNCOA06MXS02P.ONE-06.GRP> <6830_1348483308_506038EC_6830_5625_1_E4DFA2E3210FA443B032684B39D16BB4092FB6683E@THSNCOA06MXS02P.ONE-06.GRP> In-Reply-To: <6830_1348483308_506038EC_6830_5625_1_E4DFA2E3210FA443B032684B39D16BB4092FB6683E@THSNCOA06MXS02P.ONE-06.GRP> Subject: Re: Bug in AbstracJdbc2Statement.replaceProcessing when using dollar quoting? Date: Mon, 24 Sep 2012 11:49:23 -0400 Message-ID: <003e01cd9a6c$2b6ea770$824bf650$@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQI+ZV0iQ92YvBLV3Nq2AMHb27DsQQD4mz0iAjnGRI0BptNbhAJv2iczAbC7PwoBa8OOGQIPitpZllRe9dA= Content-Language: en-us X-Pg-Spam-Score: -2.8 (--) X-Archive-Number: 201209/63 X-Sequence-Number: 23299 > Hi Dave, > I don't want this feature removed. I just would like to see this fixed so that > dollar quoted strings are correctly seen as strings, and therefor without sql > escape clauses replacing. Like the comment for replaceProcessing says "look > through non-string sql code". Dollar quoted strings are strings for postgresql. > But they are not "strings" for JDBC. The JDBC syntax is a distinct entity and if you use JDBC features you are expected to adhere to its standards. Furthermore, the code comment in the driver does not constitute the canonical behavior of the JDBC specification. Regardless of whether the JDBC specification addresses what a valid "string delimiter" is the fact remains that such a definition has to be made at the JDBC level if the definition is used to implement a JDBC-only feature. Since unquoted identifiers can include the dollar-sign in PostgreSQL a broader analysis of the entire query is going to be required. It would behoove whoever decides to implement this to look and see exactly how PostgreSQL itself handles identification of dollar-quoting versus dollar-including-identifiers. The semantics and definition, though, are pretty much meaningless. Someone still has to actually code an implementation regardless of whether it is a "bug" or a "enhancement". Or, as mentioned before, you can simply fix your own environment so that you can enable or disable escape processing as you deem necessary. I still feel that mixing the two behaviors is wrong and no attempt to do so should be made. At best identify that mixing has occurred and thrown an exception. At worse ignore the escapes and let the database inform the user of their error.