Re: Variable LIMIT and OFFSET in SELECTs - Mailing list pgsql-general

From Tom Lane
Subject Re: Variable LIMIT and OFFSET in SELECTs
Date
Msg-id 27857.1195198394@sss.pgh.pa.us
Whole thread Raw
In response to Re: Variable LIMIT and OFFSET in SELECTs  (Reg Me Please <regmeplease@gmail.com>)
Responses Re: Variable LIMIT and OFFSET in SELECTs  (Reg Me Please <regmeplease@gmail.com>)
List pgsql-general
Reg Me Please <regmeplease@gmail.com> writes:
>> 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 ...

> So it works, but it's not serious enough to be unlocked.

You really don't have a clue what this is about, do you?
Let me try to explain one more time.  You propose allowing

    select ... from
      table1 join table2 on table1.x = table2.y
      limit table1.z

Now this would be somewhat well-defined if there were only one row in
table1, or if there were many rows but they all had the same value
in column z.  But what if that's not the case?  If there are multiple
possible values for z then the query is just not sensible.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Variable LIMIT and OFFSET in SELECTs
Next
From: Anton
Date:
Subject: ERROR: out of memory