Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5CGwZE53355 for ; Tue, 12 Jun 2001 12:58:35 -0400 (EDT) (envelope-from pgsql-general-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f57IwhE59729; Thu, 7 Jun 2001 14:58:44 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f57IrO935282; Thu, 7 Jun 2001 14:53:24 -0400 (EDT) (envelope-from news) From: alla@sergey.com (Alla) X-Newsgroups: comp.databases.postgresql.general,comp.databases.postgresql.sql Subject: Function returning record Date: 7 Jun 2001 11:53:22 -0700 Organization: http://groups.google.com/ Lines: 32 Message-ID: <9275d56e.0106071053.2f5d8d8f@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-support@google.com To: pgsql-general@postgresql.org.pgsql-sql@postgresql.org X-Archive-Number: 200106/424 X-Sequence-Number: 10815 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