pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSelect (1-3)
4+ messages / 3 participants
[nested] [flat]
* Select (1-3)
@ 2006-11-30 18:30 Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Ezequias Rodrigues da Rocha @ 2006-11-30 18:30 UTC (permalink / raw)
To: pgsql-sql
Hi list,
It is possible to make a selection like
Select (list 1 to 1000);
And get the rows ?
producao=# select ...;
row
---------
1
2
3
.
.
.
1000
----------
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Select (1-3)
@ 2006-11-30 18:35 Aaron Bono <postgresql@aranya.com>
parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: Aaron Bono @ 2006-11-30 18:35 UTC (permalink / raw)
To: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>; +Cc: pgsql-sql
On 11/30/06, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
>
> Hi list,
>
> It is possible to make a selection like
>
> Select (list 1 to 1000);
>
> And get the rows ?
>
> producao=# select ...;
> row
> ---------
> 1
> 2
> 3
> .
> .
> .
> 1000
>
*select * from generate_series(1, 1000);*
See
http://oreillynet.com/pub/a/databases/2006/09/07/plpgsql-batch-updates.html?page=2
--
==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
http://codeelixir.com
==================================================================
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Select (1-3)
@ 2006-11-30 18:36 Alvaro Herrera <alvherre@commandprompt.com>
parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2006-11-30 18:36 UTC (permalink / raw)
To: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>; +Cc: pgsql-sql
Ezequias Rodrigues da Rocha wrote:
> Hi list,
>
> It is possible to make a selection like
>
> Select (list 1 to 1000);
Sure, use the generate_series() function.
select * from generate_series(1, 1000);
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Select (1-3)
@ 2006-11-30 18:43 Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
parent: Aaron Bono <postgresql@aranya.com>
0 siblings, 0 replies; 4+ messages in thread
From: Ezequias Rodrigues da Rocha @ 2006-11-30 18:43 UTC (permalink / raw)
To: Aaron Bono <postgresql@aranya.com>; +Cc: pgsql-sql
Uow !
1 to one m
select * from generate_series(1, 1000000);
In 5203 miliseconds (that's a great performmance). My server is not
quite good but the performance was great for me.
Thank you so much
Ezequias
2006/11/30, Aaron Bono <postgresql@aranya.com>:
> On 11/30/06, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
> > Hi list,
> >
> > It is possible to make a selection like
> >
> > Select (list 1 to 1000);
> >
> > And get the rows ?
> >
> > producao=# select ...;
> > row
> > ---------
> > 1
> > 2
> > 3
> > .
> > .
> > .
> > 1000
> >
>
> select * from generate_series(1, 1000);
>
> See
> http://oreillynet.com/pub/a/databases/2006/09/07/plpgsql-batch-updates.html?page=2
>
> --
> ==================================================================
> Aaron Bono
> Aranya Software Technologies, Inc.
> http://www.aranya.com
> http://codeelixir.com
> ==================================================================
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2006-11-30 18:43 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-30 18:30 Select (1-3) Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2006-11-30 18:35 ` Aaron Bono <postgresql@aranya.com>
2006-11-30 18:43 ` Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2006-11-30 18:36 ` Alvaro Herrera <alvherre@commandprompt.com>
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