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.