pl/pgsql documentation

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: pl/pgsql documentation
Date: 2001-01-26 00:17:23
Message-ID: 200101260017.f0Q0HNr91237@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Darcy (Darcy(at)ok-connect(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
pl/pgsql documentation

Long Description
The following documentation does not apear to reflect real world use.

[<<label>>]
FOR record | row IN select_clause LOOP
statements
END LOOP;

(as snipped from http://postgresql.readysetnet.com/users-lounge/docs/7.0/postgres/c40914117.htm)

Sample Code
CREATE TABLE major_groups(id SERIAL, name TEXT);
INSERT INTO major_groups(name) VALUES 'one';
INSERT INTO major_groups(name) VALUES 'two';
INSERT INTO major_groups(name) VALUES 'three';

CREATE FUNCTION test3(INT4) RETURNS INT4 AS '
DECLARE
loc INT4;
BEGIN
loc := $1;
for i IN (select id from major_groups) loop
(
loc := $loc + $i;
)
end loop;
return $loc;
end;
' language 'plpgsql';

select test3(2);

NOTICE: plpgsql: ERROR during compile of test3 near line 10
ERROR: parse error at or near ";"

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Karel Zak 2001-01-26 02:31:55 Re: round - timestamp bug
Previous Message Bruno Wolff III 2001-01-25 23:56:55 Re: round - timestamp bug