| From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
|---|---|
| To: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
| Cc: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Bug(s) or not? |
| Date: | 2003-05-26 11:29:25 |
| Message-ID: | 20030526112925.GA18075@wolff.to |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, May 26, 2003 at 14:17:52 +0400,
Teodor Sigaev <teodor(at)sigaev(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | XST | 2003-05-26 12:38:19 | Tom and Fernando: Status for "WITH RECURSIVE" |
| Previous Message | Teodor Sigaev | 2003-05-26 10:17:52 | Bug(s) or not? |