Re: psql's \h MOVE

Lists: pgsql-docs
From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Docs <pgsql-docs(at)postgresql(dot)org>
Subject: psql's \h MOVE
Date: 2011-04-01 15:17:18
Message-ID: 1301670352-sup-4920@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

I just noticed that \h MOVE is particularly unhelpful:

alvherre=# \h move
Command: MOVE
Description: position a cursor
Syntax:
MOVE [ direction { FROM | IN } ] cursorname

The problem is that it doesn't specify what "direction" is. The doc
text tells you to look into FETCH for details, but in \h you have to
guess.

We could fix this by including a note about fetch in the <synopsis>,
so that it'd look like this:

alvherre=# \h move
Command: MOVE
Description: position a cursor
Syntax:
MOVE [ direction [ FROM | IN ] ] cursor_name

See FETCH for details on direction

This, of course, also appears in the HTML output.

This requires this simple patch:

--- a/doc/src/sgml/ref/move.sgml
+++ b/doc/src/sgml/ref/move.sgml
@@ -27,6 +27,8 @@ PostgreSQL documentation
<refsynopsisdiv>
<synopsis>
MOVE [ <replaceable class="PARAMETER">direction</replaceable> [ FROM | IN ] ] <replaceable class="PARAMETER">cursor_name</replaceable>
+
+<phrase>See <command>FETCH</command> for details on <replaceable class="PARAMETER">direction</replaceable>.</phrase>
</synopsis>
</refsynopsisdiv>

Would anybody object to doing things this way?

The alternative I see is to expand the "direction" in the MOVE synopsis,
but it is repetitive and would require more maintenance should we ever
decide to change the possible directions.

--
Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: psql's \h MOVE
Date: 2011-04-02 16:53:08
Message-ID: 26889.1301763188@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> I just noticed that \h MOVE is particularly unhelpful:
> alvherre=# \h move
> Command: MOVE
> Description: position a cursor
> Syntax:
> MOVE [ direction { FROM | IN } ] cursorname

> The problem is that it doesn't specify what "direction" is. The doc
> text tells you to look into FETCH for details, but in \h you have to
> guess.

> We could fix this by including a note about fetch in the <synopsis>,
> so that it'd look like this:

> alvherre=# \h move
> Command: MOVE
> Description: position a cursor
> Syntax:
> MOVE [ direction [ FROM | IN ] ] cursor_name

> See FETCH for details on direction

-1 ... if this annoys you, just duplicate the definition of direction
from FETCH.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: psql's \h MOVE
Date: 2011-04-04 00:37:39
Message-ID: BANLkTi=i=OFvkj0t_JK+0qvFwMi5db5_Jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Sat, Apr 2, 2011 at 12:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
>> I just noticed that \h MOVE is particularly unhelpful:
>>       alvherre=# \h move
>>       Command:     MOVE
>>       Description: position a cursor
>>       Syntax:
>>       MOVE [ direction { FROM | IN } ] cursorname
>
>> The problem is that it doesn't specify what "direction" is.  The doc
>> text tells you to look into FETCH for details, but in \h you have to
>> guess.
>
>> We could fix this by including a note about fetch in the <synopsis>,
>> so that it'd look like this:
>
>>       alvherre=# \h move
>>       Command:     MOVE
>>       Description: position a cursor
>>       Syntax:
>>       MOVE [ direction [ FROM | IN ] ] cursor_name
>
>>       See FETCH for details on direction
>
> -1 ... if this annoys you, just duplicate the definition of direction
> from FETCH.

+1 for duplicating the definition.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: psql's \h MOVE
Date: 2011-04-04 16:11:11
Message-ID: 1301933131-sup-7414@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

Excerpts from Robert Haas's message of dom abr 03 20:37:39 -0400 2011:
> On Sat, Apr 2, 2011 at 12:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> >> I just noticed that \h MOVE is particularly unhelpful:
> >>       alvherre=# \h move
> >>       Command:     MOVE
> >>       Description: position a cursor
> >>       Syntax:
> >>       MOVE [ direction { FROM | IN } ] cursorname
> >
> >> The problem is that it doesn't specify what "direction" is.  The doc
> >> text tells you to look into FETCH for details, but in \h you have to
> >> guess.

> > -1 ... if this annoys you, just duplicate the definition of direction
> > from FETCH.
>
> +1 for duplicating the definition.

Done that way.

(I'd like to have something like \h column_constraint for common stuff
in ALTER TABLE and CREATE TABLE, but that'll have to wait.)

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support