Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C1EDA9FA5ED for ; Wed, 11 Apr 2007 05:51:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18088-06 for ; Wed, 11 Apr 2007 05:51:10 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by postgresql.org (Postfix) with ESMTP id 1CE4B9FB1E6 for ; Wed, 11 Apr 2007 05:51:09 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id k3so60935ugf for ; Wed, 11 Apr 2007 01:51:08 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding:sender; b=d45XW5KNF/xdscmfeITEIEoaf7D1vEWtg1x1ffNdjKPPjjgbZUu9kty78Ju/rnHkTza12dBM7oCXj5yTEvFwZNdHS9zhIDjkxmoIBsSUTiYgKrxIdo+vdVGQIviwKQVnFMyMoU+JKgKixNEAM2xw4aXz0Jh644TPDBLxnN/91qU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding:sender; b=lJxK2G3KbldGTbHpM3zmjHvKs/HR2/K7AytEoztpLrbJyvuDpczhTyOTBu/j+1eZN0Jw4+2gxSmzz17Qrn2FLJ2T7ucyU2Vc0OlNLVz1zTleiNyDf2z1u3wcbS6Zvap26X0SE0J4lgue9M9B6lVXJiBpK/d7/7jp2UrS2R0Zt+g= Received: by 10.67.32.19 with SMTP id k19mr297096ugj.1176281468788; Wed, 11 Apr 2007 01:51:08 -0700 (PDT) Received: from ?192.168.1.32? ( [82.247.148.168]) by mx.google.com with ESMTP id e1sm1860444ugf.2007.04.11.01.51.06; Wed, 11 Apr 2007 01:51:06 -0700 (PDT) Message-ID: <461CA179.8010602@free.fr> Date: Wed, 11 Apr 2007 10:51:05 +0200 From: "Xavier Poinsard" User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: Kris Jurka CC: pgsql-jdbc@postgresql.org Subject: Re: random escape function References: In-Reply-To: X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/17 X-Sequence-Number: 16866 Ok, you can remove this mapping. Kris Jurka a écrit : > > The escape function {fn rand(param)} isn't working on 8.3 servers > because setseed has been changed to return void and reading the JDBC > spec, I'm not sure it ever worked as required. > > We map "SELECT {fn rand(0.5)}" to "SELECT setseed(0.5)*0+random()" which > worked in previous servers because the setseed call returned an int. > Now we get "ERROR: operator does not exist: void * integer". So that's > our immediate problem, but looking a little closer at the spec shows > that rand is supposed to take an integer argument, not a float limited > to 0->1. So at minimum we'd need to remap the parameter range. > > Also the spec doesn't say what rand is actually supposed to do. What is > the purpose of providing a rand function if you have to supply a seed > every single time. The seed has to be random, so where does that come > from? Is the idea that you pass the same seed every time and get the > next value from that seed's stream? > > Given the above functional and definitional problems I think the easiest > course of action is to simply remove the mapping. > > Kris Jurka > >