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

From Tom Lane
Subject Re: proposal or just idea for psql - show first N rows from relation backslash statement
Date
Msg-id 19631.1360799063@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal or just idea for psql - show first N rows from relation backslash statement  (Ian Lawrence Barwick <barwick@gmail.com>)
List pgsql-hackers
Ian Lawrence Barwick <barwick@gmail.com> writes:
> 2013/2/14 Tom Lane <tgl@sss.pgh.pa.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



pgsql-hackers by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: proposal or just idea for psql - show first N rows from relation backslash statement
Next
From: Fabrízio de Royes Mello
Date:
Subject: Re: proposal or just idea for psql - show first N rows from relation backslash statement