pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Xavier Poinsard <xpoinsard@free.fr>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: random escape function
Date: Wed, 11 Apr 2007 10:51:05 +0200
Message-ID: <461CA179.8010602@free.fr> (raw)
In-Reply-To: <Pine.BSO.4.64.0704110403090.13329@leary.csoft.net>
References: <Pine.BSO.4.64.0704110403090.13329@leary.csoft.net>

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
> 
> 




view thread (4+ messages)  latest in thread

Message-ID: <461CA179.8010602@free.fr>
Permalink:  ../461CA179.8010602@free.fr/
Also on:    postgresql.org/message-id/461CA179.8010602@free.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: xpoinsard@free.fr, books@ejurka.com
  Subject: Re: random escape function
  In-Reply-To: <461CA179.8010602@free.fr>
  References: <Pine.BSO.4.64.0704110403090.13329@leary.csoft.net> <461CA179.8010602@free.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox