Re: setseed accepts bad seeds

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: setseed accepts bad seeds
Date: 2008-03-10 04:15:05
Message-ID: 28577.1205122505@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Kris Jurka <books(at)ejurka(dot)com> writes:
> On Wed, 11 Apr 2007, Tom Lane wrote:
>> It's not really possible to use it "incorrectly", AFAICS. Any value you
>> might pass to it will result in a specific new seed value. Nowhere is
>> there any guarantee of what the mapping is, and it's obviously
>> impossible to guarantee that the mapping is one-to-one, so any user
>> assumptions about what a specific seed value might "mean" seem broken
>> regardless.

> Then please consider this patch which checks the range and maps the
> provided value to the entire seed space.

I'm still not very happy about this. It'll change the behavior of
existing applications, in the service of no goal that I consider
convincing.

I'd be inclined to leave the mapping alone and just insert a warning
(or hard error) for inputs outside the range -1 to 1.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kris Jurka 2008-03-10 06:14:07 Re: setseed accepts bad seeds
Previous Message Euler Taveira de Oliveira 2008-03-10 02:08:36 Re: [BUGS] BUG #3975: tsearch2 index should not bomb out of 1Mb limit