Re: select from sequences - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: select from sequences
Date
Msg-id b42b73150702120605u40cf66a4t361aa5890123271@mail.gmail.com
Whole thread Raw
In response to Re: select from sequences  ("Jaime Casanova" <systemguards@gmail.com>)
List pgsql-hackers
On 2/11/07, Jaime Casanova <systemguards@gmail.com> wrote:
> On 2/11/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > "Jaime Casanova" <systemguards@gmail.com> writes:
> > > just for curiosity, why the code doesn't throw an error when using
> > > sequences in the from_list of a select?
> >
> > That's a feature, not a bug.
> >
>
> and why is this a feature? i mean, what real use it has?

I use it all the time.  You can query the sequence for its last value
without using it first.  This is a lot more useful than it appears on
the surface.

merlin


pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas ADI SD"
Date:
Subject: Re: HOT for PostgreSQL 8.3
Next
From: mark@mark.mielke.cc
Date:
Subject: Re: HOT for PostgreSQL 8.3