Error when following a documentation

Поиск
Список
Период
Сортировка
От PG Doc comments form
Тема Error when following a documentation
Дата
Msg-id 153546923124.1483.6767374163616255141@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: Error when following a documentation  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/plpgsql-cursors.html
Description:

As specified On page
https://www.postgresql.org/docs/10/static/plpgsql-cursors.html#PLPGSQL-CURSOR-OPENING
i am trying to run below commands 
-------------------------------------------------
DECLARE
    key integer;
    curs4 CURSOR FOR SELECT * FROM tenk1 WHERE unique1 = key;
BEGIN
    key := 42;
    OPEN curs4;
--------------------------------------------------------
but i am getting below errors, please help
--------------------------------------------------------
postgres=# 
postgres=# SELECT VERSION();
                                                 version
            
                
-----------------------------------------------------------------------------------------
----------------
 PostgreSQL 10.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7
20120313 (Red Hat 4.
4.7-18), 64-bit
(1 row)

postgres=# DECLARE
postgres-#     key integer;
ERROR:  syntax error at or near "integer"
LINE 2:     key integer;
                ^
postgres=#     curs4 CURSOR FOR SELECT * FROM tenk1 WHERE unique1 = key;
ERROR:  syntax error at or near "curs4"
LINE 1: curs4 CURSOR FOR SELECT * FROM tenk1 WHERE unique1 = key;
        ^
postgres=# BEGIN
postgres-#     key := 42;
ERROR:  syntax error at or near "key"
LINE 2:     key := 42;
            ^
postgres=#     OPEN curs4;
ERROR:  syntax error at or near "OPEN"
LINE 1: OPEN curs4;
        ^
postgres=# 

--------------------------------------------------------

В списке pgsql-docs по дате отправления:

Предыдущее
От: Flavio Henrique Araque Gurgel
Дата:
Сообщение: Limitation of prepared statement name
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Error when following a documentation