public inbox for [email protected]  
help / color / mirror / Atom feed
From: PG Doc comments form <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Error when following a documentation
Date: Tue, 28 Aug 2018 15:13:51 +0000
Message-ID: <[email protected]> (raw)

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=# 

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


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Error when following a documentation
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox