Skip site navigation (1) Skip section navigation (2)

Re: pg_generate_sequence and info_schema patch (Was: SELECT

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: "pgsql-patches(at)postgresql(dot)org" <pgsql-patches(at)postgresql(dot)org>
Cc: Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: pg_generate_sequence and info_schema patch (Was: SELECT
Date: 2004-02-05 00:20:56
Message-ID: 40218C68.5000509@bigfoot.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-patches
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe Conway wrote:
| Tom Lane wrote:
|
|> Maybe the best documentation answer is to create a new subsection in the
|> Functions chapter.  This may be our first standard set-returning
|> function but I bet it will not be the last, so the shortness of the
|> subsection doesn't bother me.
|
|
| A first shot at documentation for generate_series() is available here in
| html form:
| http://www.joeconway.com/functions-srf.html

I seen there:


select * from generate_series(5,1,-2);
~ generate_series
- -----------------
~               5
~               3
~               1
(3 rows)


I understood on your past posts that instead this result
was obtained with:

select * from generate_series(5,1,2);
~ generate_series
- -----------------
~               5
~               3
~               1
(3 rows)


I think that is better have:
~  if start < end the series is ascending
~  if start > end the series is descending

~  if step > 0 the series is ascending
~  if step < 0 the series is descending
~  ( step can not be 0 )

if ( start < end ) and ( step < 0 ) the result set is empty
if ( start > end ) and ( step > 0 ) the result set is empty


IMHO this is the more natural behavior.


my 2 cents.



Regards
Gaetano Mendola













-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAIYxo7UpzwH2SGd4RAnr9AJ4//4AO9VaIQmweneB0BJe8DvKJQgCfSJOF
ejQN8TlGBjvntxoBJgk3uIk=
=HcPJ
-----END PGP SIGNATURE-----


In response to

Responses

pgsql-patches by date

Next:From: Claudio NatoliDate: 2004-02-05 01:17:41
Subject: Re: win32 signals, part 4
Previous:From: Magnus HaganderDate: 2004-02-04 23:15:44
Subject: Re: temp patch for win32 readdir issue

pgsql-general by date

Next:From: Mike MascariDate: 2004-02-05 00:31:33
Subject: Re: Improving performance with a Function instead of a
Previous:From: Oleg LebedevDate: 2004-02-05 00:08:37
Subject: dblink: rollback transaction

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group