Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3p8I-0007ST-8I for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 22:12:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i3p8E-0000MD-VE for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 22:12:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3p8E-0000M6-Lg for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2019 22:12:34 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3p87-0001XH-E8 for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2019 22:12:33 +0000 Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id 46Kty12vgYzkqN for ; Fri, 30 Aug 2019 18:12:25 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 17622) id 46Kty11sjSz1ZVM; Fri, 30 Aug 2019 18:12:25 -0400 (EDT) Date: Fri, 30 Aug 2019 18:12:25 -0400 From: stan To: pgsql-general@lists.postgresql.org Subject: Re: Returning a table from a function, that requires multiple selects? Message-ID: <20190830221225.GA12804@panix.com> References: <20190830200315.GA28175@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190830200315.GA28175@panix.com> X-Editor: gVim User-Agent: Mutt/1.12.1 (2019-06-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Aug 30, 2019 at 04:03:15PM -0400, stan wrote: > I need to encapsulate, what are basically 2 related function calls into a single > function. The result of each of th calls is a date type. > > y current thinking is to return a 2 row table with the 2 dates in it. But, I seem to > be having issues getting this to work. > > Is it possible for a function to return a table with results from multiple > queries? > Got it working, so yes this can be done. Next I have to figure out how to configure the next function to accept this table. Error message says something about configuring it to accept a record. -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin