Thread: Pgsql-7.1RC1: SET SEED =

Pgsql-7.1RC1: SET SEED =

From
Alexey Borzov
Date:
Greetings!

The development docs state that one can use SET SEED to seed the
random number generator, yet:

newweb=# select version();
                           version
--------------------------------------------------------------
 PostgreSQL 7.1RC1 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

newweb=# set seed = 0.5;
ERROR:  'seed' is not a valid option name


SELECT setseed() works, although.

newweb=# select setseed(0.5);
  setseed
------------
 1073741823
(1 row)

Is this a bug or is SET SEED now obsolete?

--
Yours, Alexey V. Borzov, Webmaster of RDW.ru



Re: Pgsql-7.1RC1: SET SEED =

From
Tom Lane
Date:
Alexey Borzov <borz_off@rdw.ru> writes:
> The development docs state that one can use SET SEED to seed the
> random number generator

Where?  I see no such claim.  If there's something that leads you
to think that SET SEED and not setseed() is correct, then the docs
need to be fixed.

            regards, tom lane

Re: Pgsql-7.1RC1: SET SEED =

From
Peter Eisentraut
Date:
Tom Lane writes:

> Alexey Borzov <borz_off@rdw.ru> writes:
> > The development docs state that one can use SET SEED to seed the
> > random number generator
>
> Where?  I see no such claim.  If there's something that leads you
> to think that SET SEED and not setseed() is correct, then the docs
> need to be fixed.

Actually, this used to work, but for some reason it's called 'set
random_seed' now.  I seem to be responsible for this, although I can't
imagine what the motivation might have been.  Should I change it back?

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: Pgsql-7.1RC1: SET SEED =

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Actually, this used to work, but for some reason it's called 'set
> random_seed' now.  I seem to be responsible for this, although I can't
> imagine what the motivation might have been.  Should I change it back?

If "set seed" worked in 7.0.* then I think we had better stick with that
spelling.  (Tries it ... yes it did.)  "random_seed" would be a better
name if we were working in a green field, but it's not enough better to
be worth breaking backwards compatibility for.

            regards, tom lane

Re[2]: Pgsql-7.1RC1: SET SEED =

From
Alexey Borzov
Date:
Greetings, Tom!

At 29.03.2001, 12:52, you wrote:

TL> Alexey Borzov <borz_off@rdw.ru> writes:
>> The development docs state that one can use SET SEED to seed the
>> random number generator

TL> Where?  I see no such claim.

Right here:
http://www.postgresql.org/devel-corner/docs/postgres/sql-set.html

TL> If there's something that leads you
TL> to think that SET SEED and not setseed() is correct, then the docs
TL> need to be fixed.

This something is my experience with Pgsql 7.0.3, which did accept SET
SEED.
I believe the whole matter was clarified enough, so now you seem to
have two options: either change everything back, or update the docs
(add BIG BOLD letters that SET SEED is now obsolete) ;]

--
Yours, Alexey V. Borzov, Webmaster of RDW



Re: Re[2]: Pgsql-7.1RC1: SET SEED =

From
Tom Lane
Date:
Alexey Borzov <borz_off@rdw.ru> writes:
> I believe the whole matter was clarified enough, so now you seem to
> have two options: either change everything back, or update the docs
> (add BIG BOLD letters that SET SEED is now obsolete) ;]

We changed it back, so the docs are still okay ;-)

            regards, tom lane