Re: Variable LIMIT and OFFSET in SELECTs
| От | Sam Mason |
|---|---|
| Тема | Re: Variable LIMIT and OFFSET in SELECTs |
| Дата | |
| Msg-id | 20071116063024.GI1955@frubble.xen.chris-lamb.co.uk обсуждение исходный текст |
| Ответ на | Re: Variable LIMIT and OFFSET in SELECTs (Richard Huxton <dev@archonet.com>) |
| Ответы |
Re: Variable LIMIT and OFFSET in SELECTs
|
| Список | pgsql-general |
On Thu, Nov 15, 2007 at 07:28:17PM +0000, Richard Huxton wrote: > Reg Me Please wrote: > >As Sam says I should be able to "put an IMMUTABLE expression into > >a LIMIT or OFFSET". And under some circumstances (SQL function > >body) it's true even with VARIABLE expressions like function call > >arguments. > > And you can. > > CREATE FUNCTION limfunc() RETURNS integer AS 'SELECT 2' LANGUAGE SQL > IMMUTABLE; > > SELECT * FROM fit LIMIT limfunc(); > a | b > ---+---- > 1 | 43 > 2 | 43 > (2 rows) 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! Sam
В списке pgsql-general по дате отправления: