table value function help

From: Glenn Schultz <glenn(at)bondlab(dot)io>
To: pgsql-general(at)postgresql(dot)org
Subject: table value function help
Date: 2018-11-22 16:25:08
Message-ID: CAE-4=KGD4fH=A0YMqYht3V6cOr4Wyd1eoH=hOtZ7TS8YCvX89g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a table value function and would like the first and second input to
take multiple arguments (array or list) I suppose. Like the below:

create or replace function myfunction(sector, agency, term)
returns table (cusip char(9), sector char(12))
language sql
stable
as $function$

select foo
from
atable
where
sector in (myfunction.sector)

usage

sectorselect('sector_1 sector_2', 'agent_1 agent_2, 120)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-11-22 16:34:09 Re: Compile postgresql libraries with VS17
Previous Message Josef Šimánek 2018-11-22 15:26:10 Re: a bug jsonb?