Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lt9CB-00014A-Ry for pgsql-sql@arkaria.postgresql.org; Tue, 15 Jun 2021 13:33:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lt9CA-0008GP-LQ for pgsql-sql@arkaria.postgresql.org; Tue, 15 Jun 2021 13:33:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lt9CA-0008GH-ER for pgsql-sql@lists.postgresql.org; Tue, 15 Jun 2021 13:33:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lt9C8-000320-8r for pgsql-sql@lists.postgresql.org; Tue, 15 Jun 2021 13:33:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15FDXSZa354525; Tue, 15 Jun 2021 09:33:28 -0400 From: Tom Lane To: Yambu cc: pgsql-sql Subject: Re: function INPUT as whole table In-reply-to: References: Comments: In-reply-to Yambu message dated "Tue, 15 Jun 2021 12:59:21 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <354523.1623764008.1@sss.pgh.pa.us> Date: Tue, 15 Jun 2021 09:33:28 -0400 Message-ID: <354524.1623764008@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Yambu writes: > Is it possible to have as input to a function , a whole table contents, if > the table is a small lookup table? Not directly, but you might be able to achieve the effect by opening a cursor and passing the cursor name to the function, which could fetch from it. See the examples in the cursor section of the plpgsql manual. regards, tom lane