Re: [GENERAL] shortcut for select * where id in (arrayvar)

2008-03-31 Thread Ivan Sergio Borgonovo
On Sun, 30 Mar 2008 21:40:52 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > for _row in > > select err, msg from errortable where err in (errcode) > > > where errcode is an array. > > That syntax doesn't work... > In recent PG releases it wi

Re: [GENERAL] shortcut for select * where id in (arrayvar)

2008-03-30 Thread Tom Lane
Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > for _row in > select err, msg from errortable where err in (errcode) > where errcode is an array. > That syntax doesn't work... In recent PG releases it will work as "WHERE err = ANY (errcode)" but note that there is *no* guarantee that th

Re: [GENERAL] shortcut for select * where id in (arrayvar)

2008-03-30 Thread brian
Ivan Sergio Borgonovo wrote: I'm still investigating on how to return array elements. I came out with something like: create or replace function auz(out _errcode int, out _errmsg text) returns setof record as $$ declare errcode int[]; errmsg text[]; _row record; begin

[GENERAL] shortcut for select * where id in (arrayvar)

2008-03-30 Thread Ivan Sergio Borgonovo
I'm still investigating on how to return array elements. I came out with something like: create or replace function auz(out _errcode int, out _errmsg text) returns setof record as $$ declare errcode int[]; errmsg text[]; _row record; begin errcode[1]:=1; er