pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jbduffy@ntlworld.com
To: pgsql-sql@postgresql.org
Subject: plpgsql function returning SETOF RECORD Question
Date: Mon, 23 Feb 2004 13:21:32 +0000
Message-ID: <20040223132208.MQDR10961.mta07-svc.ntlworld.com@mta7-svc> (raw)

Hi

When I run the function below I recieve an error message saying that column definitions need to be specified for a function returing a type RECORD.

I was under the impression that the FOR row IN SELECT... loop would assign a column structure to the RECORD type. Am I wrong about this?

CREATE FUNCTION test() RETURNS SETOF RECORD AS '
DECLARE
  row  RECORD;
BEGIN
  FOR row IN SELECT * FROM dates LOOP
    RETURN NEXT row;
  END LOOP;

  RETURN;
END;
' LANGUAGE 'plpgsql';

PostgreSQL 7.3.2-3 on Red Hat 9.

Regards

John Duffy

-----------------------------------------
Email provided by http://www.ntlhome.com/





view thread (2+ messages)  latest in thread

Message-ID: <20040223132208.MQDR10961.mta07-svc.ntlworld.com@mta7-svc>
Permalink:  ../20040223132208.MQDR10961.mta07-svc.ntlworld.com@mta7-svc/
Also on:    postgresql.org/message-id/20040223132208.MQDR10961.mta07-svc.ntlworld.com@mta7-svc

 · 

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: pgsql-sql@postgresql.org
  Cc: jbduffy@ntlworld.com
  Subject: Re: plpgsql function returning SETOF RECORD Question
  In-Reply-To: <20040223132208.MQDR10961.mta07-svc.ntlworld.com@mta7-svc>

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

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