Skip site navigation (1) Skip section navigation (2)

Re: This is a limit-offset bug?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com>
Cc: General PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: This is a limit-offset bug?
Date: 2008-12-26 16:46:42
Message-ID: 20081226164642.GA28583@svana.org (view raw or flat)
Thread:
Lists: pgsql-general
On Fri, Dec 26, 2008 at 09:52:59AM -0200, Emanuel Calvo Franco wrote:
> Hi people,
> 
> Yesterday when i was making some commands on 8.3.5
> (on Centos)
> i found a rare behavior of limit offset.
> 
> Try in psql:
> 
> select * from foo limit 3; <- shows ok
> select * from foo limit3; <- shows all rows
> select * from foo offset1223raf3w4t4tgga; <- shows all rows
> select * from foo limitsdfsdfaerfgsafqaweawe; <- shows all rows
> select * from foo limit; <- this shows error ok
> select * from foo limitt; ....

At a wild gues, if the string after the table name is a single token it
gets interpreted as an alias for the table. Remember that AS is
optional.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

In response to

Responses

pgsql-general by date

Next:From: Emanuel Calvo FrancoDate: 2008-12-26 17:17:41
Subject: Re: This is a limit-offset bug?
Previous:From: Pavel StehuleDate: 2008-12-26 15:23:52
Subject: Re: count (DISTINCT expression [ , ... ] ) and documentation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group