Re: Using generate_series to create a unique ID in a query?

Поиск
Список
Период
Сортировка
Искать
От
Jan de Visser
Тема
Re: Using generate_series to create a unique ID in a query?
Дата
Msg-id
1159c1e90711140827h2c1cf6d2r9fcab43e90c90105@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Using generate_series to create a unique ID in a query? Sarah Dougherty <sdougherty@desc.org>
Re: Using generate_series to create a unique ID in a query? "Pavel Stehule" <pavel.stehule@gmail.com>
Re: Using generate_series to create a unique ID in a query? hubert depesz lubaczewski <depesz@depesz.com>
Re: Using generate_series to create a unique ID in a query? Tom Lane <tgl@sss.pgh.pa.us>
Re: Using generate_series to create a unique ID in a query? "Jan de Visser" <jdevisser@digitalfairway.com>
Re: Using generate_series to create a unique ID in a query? Tom Lane <tgl@sss.pgh.pa.us>
Re: Using generate_series to create a unique ID in a query? "Jan de Visser" <jdevisser@digitalfairway.com>
Re: Using generate_series to create a unique ID in a query? hubert depesz lubaczewski <depesz@depesz.com>
Re: Using generate_series to create a unique ID in a query? Tom Lane <tgl@sss.pgh.pa.us>
Re: Using generate_series to create a unique ID in a query? Decibel! <decibel@decibel.org>
On 11/14/07, Tom Lane  wrote:
> hubert depesz lubaczewski  writes:
> > On Mon, Nov 12, 2007 at 03:11:50PM -0800, Sarah Dougherty wrote:
> >> To recap with an example, the query below works fine, but how do I add a
> >> series to it?
>
> > generate_series will not help with this.
> > try the sequence approach, or this:
> > http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in-one-query/
>
> That's a fairly ugly/messy way of doing it.  If you're going to need a C
> function anyway, why not just do it directly?  As in the attachment.
>
> regression=# create function rownum() returns int as '/home/tgl/pgsql/rownum'
> regression-# language c;
> CREATE FUNCTION

Any reason why this couldn't appear in the core of some future
version? I've been wanting something like this a couple of times
before. Note that Oracle has it as well.

jan
В списке pgsql-general по дате отправления
От: Andrew Sullivan
Дата:
От: Tom Lane
Дата:
FAQ