Remove ROW | ROWS from OFFSET and FETCH - Mailing list pgsql-hackers

From Thom Brown
Subject Remove ROW | ROWS from OFFSET and FETCH
Date
Msg-id bddc86151003251701t37ec6f67ida1788e67b5d0543@mail.gmail.com
Whole thread Raw
Responses Re: Remove ROW | ROWS from OFFSET and FETCH
List 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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Re: [GENERAL] question (or feature-request): over ( partition by ... order by LIMIT N)
Next
From: Marko Tiikkaja
Date:
Subject: Re: Remove ROW | ROWS from OFFSET and FETCH