Remove ROW | ROWS from OFFSET and FETCH

From: Thom Brown <thombrown(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Remove ROW | ROWS from OFFSET and FETCH
Date: 2010-03-26 00:01:54
Message-ID: bddc86151003251701t37ec6f67ida1788e67b5d0543@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was wondering if it might be worth making ROW/ROWS optional for
OFFSET and FETCH clauses? And can ONLY be optional too?

So:

OFFSET start { ROW | ROWS }
FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY

Would become

OFFSET start [ ROW | ROWS ]
FETCH { FIRST | NEXT } [ count ] [ ROW | ROWS ] [ONLY]

So instead of:

SELECT *
FROM my_table
OFFSET 4 ROWS
FETCH FIRST 10 ROWS ONLY;

one could write:

SELECT *
FROM my_table
OFFSET 4
FETCH FIRST 10;

The only case where ROW would be mandatory would be for FETCH FIRST ROW ONLY.

...although I suspect I'm missing something obvious or reasonable here ;)

Thom

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2010-03-26 00:14:20 Re: Remove ROW | ROWS from OFFSET and FETCH
Previous Message Robert Haas 2010-03-25 22:50:19 Re: Re: [GENERAL] question (or feature-request): over ( partition by ... order by LIMIT N)