Re: proposal or just idea for psql - show first N rows from relation backslash statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal or just idea for psql - show first N rows from relation backslash statement
Date: 2013-02-13 23:44:23
Message-ID: 19631.1360799063@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ian Lawrence Barwick <barwick(at)gmail(dot)com> writes:
> 2013/2/14 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> Can't you pretty much do this already in psql with FETCH_COUNT? I see
>> no good reason to invent more SQL syntax.

> Doesn't that just split up the retrieval of the result set into blocks of
> FETCH_COUNT rows, i.e. does not limit the result set?

Well, you'll get a page worth of data before your pager blocks it,
and then you can continue, or not, for relatively little cost.
I can't see that fetching a fixed number of rows is more useful
than that.

[ experiments... ] Although I notice that psql's FETCH_COUNT logic
doesn't realize that it could be applied to a "TABLE foo" query.
That seems like it might be worth fixing.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2013-02-14 00:16:21 Re: proposal or just idea for psql - show first N rows from relation backslash statement
Previous Message Ian Lawrence Barwick 2013-02-13 23:34:42 Re: proposal or just idea for psql - show first N rows from relation backslash statement