Re: subquery in limit

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>
Cc: "Grzegorz Jaskiewicz" <gj(at)pointblue(dot)com(dot)pl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: subquery in limit
Date: 2008-02-15 15:44:35
Message-ID: 3176.1203090275@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com> writes:
> I have no idea why you can't do a subquery in the limit

It hasn't seemed worth putting any effort into --- AFAIR this is the
first time anyone's even inquired about it. As you say, you can always
use a function.

> And I'm sure someone will point out a more efficient way to write my
> function without using pl/pgsql. :)

Only that it doesn't seem a particularly bright idea to use SECURITY
DEFINER for a function that will execute any arbitrary caller-provided
SQL ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roberts, Jon 2008-02-15 15:46:21 Re: subquery in limit
Previous Message Tom Lane 2008-02-15 15:28:15 Re: ANALYZE to be ignored by VACUUM