Re: Variable LIMIT and OFFSET in SELECTs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Variable LIMIT and OFFSET in SELECTs
Date: 2007-11-16 06:38:30
Message-ID: 27028.1195195110@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sam Mason <sam(at)samason(dot)me(dot)uk> writes:
> wow, that's kind of fun isn't it. I only thought you could put a
> constant in there. Maybe I should have had a look in the grammar/tested
> it first!

IIRC, it used to be restricted to a constant, a few revisions back.
In current releases the only restriction that stems from laziness is
not allowing a sub-select. (If anyone were to put forward a serious
use-case, we'd probably go fix that.)

The OP's complaint is that we don't allow a variable of the query's own
level, but AFAICT he's still not grasped the point that that leads to an
indeterminate limit value ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2007-11-16 06:53:49 Re: Variable LIMIT and OFFSET in SELECTs
Previous Message Sam Mason 2007-11-16 06:30:25 Re: Variable LIMIT and OFFSET in SELECTs