On þri, 2006-11-28 at 01:12 -0800, Matthew Peter wrote:
> I'll jump right in with an example
>
> create sequence foo start with 1;
>
> create view foobar as select *, nextval('foo') from bar;
>
> The problem is I need a nextval()-like method that returns the iterations
> without
> updating the foo sequence. Therefore, maintaining the sequences original
> value by
> starting at 1 each time the foobar VIEW is invoked.
sounds like you do not really want sequences. (think of
concurrent selects from such a view)
the most natural way to do this is in the application
layer, but if you have to do this in the backend, you
could do it with a pl/pgsql user defined set returning
function, I guess.
gnari
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match