Commit e7d5ffe8 authored by Peter Eisentraut's avatar Peter Eisentraut

doc: Improve example formatting

Erwin Brandstetter
parent 53ecfddc
...@@ -1694,13 +1694,13 @@ CREATE TABLE foo (fooid INT, foosubid INT, fooname TEXT); ...@@ -1694,13 +1694,13 @@ CREATE TABLE foo (fooid INT, foosubid INT, fooname TEXT);
INSERT INTO foo VALUES (1, 2, 'three'); INSERT INTO foo VALUES (1, 2, 'three');
INSERT INTO foo VALUES (4, 5, 'six'); INSERT INTO foo VALUES (4, 5, 'six');
CREATE OR REPLACE FUNCTION getAllFoo() RETURNS SETOF foo AS CREATE OR REPLACE FUNCTION get_all_foo() RETURNS SETOF foo AS
$BODY$ $BODY$
DECLARE DECLARE
r foo%rowtype; r foo%rowtype;
BEGIN BEGIN
FOR r IN SELECT * FROM foo FOR r IN
WHERE fooid > 0 SELECT * FROM foo WHERE fooid > 0
LOOP LOOP
-- can do some processing here -- can do some processing here
RETURN NEXT r; -- return current row of SELECT RETURN NEXT r; -- return current row of SELECT
...@@ -1710,7 +1710,7 @@ END ...@@ -1710,7 +1710,7 @@ END
$BODY$ $BODY$
LANGUAGE plpgsql; LANGUAGE plpgsql;
SELECT * FROM getallfoo(); SELECT * FROM get_all_foo();
</programlisting> </programlisting>
</para> </para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment