Is there a bug in FOR i IN 1..10 LOOP (8.4.4)?

From: Nick <nboutelier(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Is there a bug in FOR i IN 1..10 LOOP (8.4.4)?
Date: 2010-09-12 05:45:35
Message-ID: 9a7e70da-e230-47c8-857b-b3df7b47b8c7@y12g2000prb.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

CREATE FUNCTION test() RETURNS text
LANGUAGE plpgsql
AS $$DECLARE
num_var TEXT;
BEGIN
FOR i IN 1..10 LOOP
num_var := num_var || ',' || i;
END LOOP;
RETURN num_var;
END;$$;

SELECT test();

returns NULL

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Phui Hock 2010-09-12 06:15:20 Re: How to inherit search_path from template
Previous Message Bruce Momjian 2010-09-11 22:43:19 Re: Incrementally Updated Backups