pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: alla@sergey.com
To: pgsql-general@postgresql.org.pgsql-sql
Subject: Function returning record
Date: 7 Jun 2001 11:53:22 -0700
Message-ID: <9275d56e.0106071053.2f5d8d8f@posting.google.com> (raw)

Is it possible in PostgreSQL to write a function that would return a
record type.

What I need is something like this:

create function my_func(varchar)
return record as '
declare
   my_rec   record;
begin
   select null as field1, null as field2
   into my_rec;

   .... some processing to populate the actual values of the record

   return my_rec;
end;
' LANGUAGE 'plpgsql';


I get the following when I try to compile this:
NOTICE:  ProcedureCreate: return type 'record' is only a shell

and following when I try to execute it (even though I am not sure how
to execute this at all);
ERROR:  fmgr_info: function 0: cache lookup failed

Please help.

Thanks a lot in advance

Alla



view thread (2+ messages)  latest in thread

Message-ID: <9275d56e.0106071053.2f5d8d8f@posting.google.com>
Permalink:  ../9275d56e.0106071053.2f5d8d8f@posting.google.com/
Also on:    postgresql.org/message-id/9275d56e.0106071053.2f5d8d8f@posting.google.com

 · 

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: alla@sergey.com, pgsql-general@postgresql.org.pgsql-sql
  Subject: Re: Function returning record
  In-Reply-To: <9275d56e.0106071053.2f5d8d8f@posting.google.com>

* 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