X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id F0CABCCDB7 for ; Fri, 18 Jul 2003 17:52:43 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 80548-06 for ; Fri, 18 Jul 2003 17:53:15 +0000 (GMT) Received: from exchange.hq.openratings.com (unknown [141.149.165.226]) by svr1.postgresql.org (Postfix) with ESMTP id C142BCCDB3 for ; Fri, 18 Jul 2003 14:52:41 -0300 (ADT) Received: from openratings.com (cancun.hq.openratings.com [10.0.0.225]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 38QM49BF; Fri, 18 Jul 2003 13:53:13 -0400 Message-ID: <3F183423.9030900@openratings.com> Date: Fri, 18 Jul 2003 13:53:39 -0400 From: Dmitry Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kim Ho Cc: Fernando Nasser , Barry Lind , pgsql-jdbc-list Subject: Re: Prepared Statements References: <3F174BFF.3070704@xyth os.com> <3F1801C5.9030104@openratings.com> <3F181A81.70208@xythos.com> <3F18259C.6090503@redhat.com> <1058548037.19658.159.camel@topanga.toronto.redhat.com> <3F183004.4010508@openratings.com> <3F1830F6.3020203@openratings.com> <1058550328.19657.168.camel@topanga.toronto.redhat.com> In-Reply-To: <1058550328.19657.168.camel@topanga.toronto.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/147 X-Sequence-Number: 7531 Kim Ho wrote: >Can't you instead use setString(1, "x'a'")? > Nope - that will get converted into ... where id='x\'a\'' - that won't be understood by the backend - it wants it *exactly* that way - x outside the quotes, followed by a quoted hexademical number... > >If not, this also brings up another thing. Did you want to treat "x'a'" >as a number now? > Yes, I did (and still do) :-) > >In any case, here is a revised version of the patch. =) Thanks for the >pointers. > I must be missing something, but I don't see any difference with the previous version .... > >Also, the remove radix thing is not meant for preventing SQL injection. >It is meant for this like: > >create function integer_in(integer) .... > >and then using things like select integer_in(1.11231E9) > I understand that. I was just saying that adding quotes around the input doesn't help much in preventing injections, but does take away valuable functionality... Dima