Re: Bug(s) or not? - Mailing list pgsql-hackers

From Bruno Wolff III
Subject Re: Bug(s) or not?
Date
Msg-id 20030526112925.GA18075@wolff.to
Whole thread Raw
In response to Bug(s) or not?  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
On Mon, May 26, 2003 at 14:17:52 +0400, Teodor Sigaev <teodor@sigaev.ru> wrote:
> 
> q=# select count(*) from q;
>  count
> -------
>      2
> (1 row)
> 
> q=# select count(*) from q limit 1;
>  count
> -------
>      2
> (1 row)
> 
> q=# select count(*) from q limit 1 offset 1;
>  count
> -------
> (0 rows)
> 
> q=# select count(*) from q  offset 1;
>  count
> -------
> (0 rows)
> 
> q=# select count(*) from q  offset 0;
>  count
> -------
>      2
> (1 row)
> 
> I understand that it isn't correct query, but why pgsql do something 
> strange instead of say 'error'?

The above queries appear to be correct. The count returns a single row
with the number of rows in the table. If you skip over that row using
offset, you aren't going to get any rows.


pgsql-hackers by date:

Previous
From: Teodor Sigaev
Date:
Subject: Bug(s) or not?
Next
From: XST
Date:
Subject: Tom and Fernando: Status for "WITH RECURSIVE"