Re: Doc patch

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: Doc patch
Дата
Msg-id
Yv+0puewkCOgcwr5@momjian.us
Ответ на
Doc patch (rir)
Список
Дерево обсуждения
Doc patch rir <rirans@comcast.net>
Re: Doc patch Laurenz Albe <laurenz.albe@cybertec.at>
Re: Doc patch Bruce Momjian <bruce@momjian.us>
Re: Doc patch Bruce Momjian <bruce@momjian.us>
On Fri, Oct 15, 2021 at 12:52:48PM -0400, rir wrote:
> 
> In pgsql-docs, this patch has been recommended to you.
> 
> Lacking consensus and so not included is the the deletion of
> comments pointing between the ref/MOVE and FETCH files.  These
> were of the form:
> 
>     

Sorry, I am just looking at this patch.

> diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml
> index 4cd4bcba80..1cadec3dc4 100644
> --- a/doc/src/sgml/plpgsql.sgml
> +++ b/doc/src/sgml/plpgsql.sgml
> @@ -3342,7 +3342,7 @@ BEGIN
>       <literal>FETCH</literal>
>  
>  
> -FETCH  direction { FROM | IN }  cursor INTO target;
> +FETCH  direction   FROM | IN  cursor INTO target;
>  

If you look at pl/plpgsql/src/pl_gram.y, you can see in
read_fetch_direction() and complete_direction() that a lot of work is
done to make sure FROM/IN appears (see check_FROM).  Therefore, I think
the above change is incorrect.  Yes, this doesn't match the backend
syntax, probably because of syntax requirements of the PL/pgSQL
language.

>  
> -MOVE  direction { FROM | IN }  cursor;
> +MOVE  direction   FROM | IN  cursor;
>  

Same above.

> diff --git a/doc/src/sgml/ref/fetch.sgml b/doc/src/sgml/ref/fetch.sgml
> index ec843f5684..5e19531742 100644
> --- a/doc/src/sgml/ref/fetch.sgml
> +++ b/doc/src/sgml/ref/fetch.sgml
> @@ -27,9 +27,9 @@ PostgreSQL documentation
>   
>  
>  
> -FETCH [ direction [ FROM | IN ] ] cursor_name
> +FETCH [ direction ] [ FROM | IN ] cursor_name
>  
> -where direction can be empty or one of:
> +where direction can one of:
>  
>      NEXT
>      PRIOR
> diff --git a/doc/src/sgml/ref/move.sgml b/doc/src/sgml/ref/move.sgml
> index 4c7d1dca39..c4d859d7b0 100644
> --- a/doc/src/sgml/ref/move.sgml
> +++ b/doc/src/sgml/ref/move.sgml
> @@ -27,9 +27,9 @@ PostgreSQL documentation
>   
>  
>  
> -MOVE [ direction [ FROM | IN ] ] cursor_name
> +MOVE [ direction ] [ FROM | IN ] cursor_name
>  
> -where direction can be empty or one of:
> +where direction can one of:

You are right about the above to changes.  The existing syntax shows
FROM/IN is only possible if a direction is specified, while
src/parser/gram.y says that FROM/IN with no direction is supported.

I plan to apply this second part of the patch soon.

-- 
  Bruce Momjian          https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson



В списке pgsql-hackers по дате отправления
От: kavya chandren
Дата:
От: Zhihong Yu
Дата:
FAQ