Re: function INPUT as whole table

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Yambu <hyambu(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: function INPUT as whole table
Date: 2021-06-15 12:41:07
Message-ID: CAKFQuwZHBrbS89GJhZnaUjPLtYcOLkiiRSBYo=MD0uMEdJYMhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, June 15, 2021, Yambu <hyambu(at)gmail(dot)com> wrote:

> Hello
>
> Is it possible to have as input to a function , a whole table contents,
> if the table is a small lookup table?
>
> Something like this
>
> CREATE or replace function test (IN (select * from table1) )
>

No. Function arguments are data types, not contents. Queries go inside
the function body.

David J.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2021-06-15 13:33:28 Re: function INPUT as whole table
Previous Message Yambu 2021-06-15 10:59:21 function INPUT as whole table