From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Scott Ribe <scott_ribe(at)elevated-dev(dot)com> |
Cc: | Postgresql General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: variadic function, query "in", help with syntax/function |
Date: | 2012-10-21 17:01:05 |
Message-ID: | CAFj8pRDH56gCMUbdoGGg+KE_p-W74+FsCmoM8EmEfJxEBuxdSQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello
2012/10/21 Scott Ribe <scott_ribe(at)elevated-dev(dot)com>:
> Briefly, what would it take to make the following work?
>
> create function getbatch (variadic ids int8[]) returns setof foobar as $$
> begin
> return query
> select * from foobar where id in (ids);
> end;
> $$ language plpgsql;
>
create function getbatch (variadic ids int8[]) returns setof foobar as $$
begin
return query
select * from foobar where id = any (ids);
end;
$$ language plpgsql;
note, for these single statement function, sql language is better
regards
Pavel Stehule
> --
> Scott Ribe
> scott_ribe(at)elevated-dev(dot)com
> http://www.elevated-dev.com/
> (303) 722-0567 voice
>
>
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Ribe | 2012-10-21 17:11:11 | Re: variadic function, query "in", help with syntax/function |
Previous Message | Scott Ribe | 2012-10-21 16:51:40 | variadic function, query "in", help with syntax/function |