how to found a variable is in a aggregation or not?

From: Yi Zhao <yi(dot)zhao(at)alibaba-inc(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: how to found a variable is in a aggregation or not?
Date: 2008-07-15 11:11:29
Message-ID: 1216120289.4051.25.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I want to check a variable is in a aggregattion or not, so I create a
function as below:

create or replace function anytest(val text) returns boolean as $$
begin
perform 1 where quote_literal(val) in ('hello', 'world', 'test');
if not found then
return false;
else
return true;
end if;
end;
$$ language plpgsql;

but when I used, I got the result below, why?

test=# select anytest('world111');
anytest
---------
f
(1 row)

test=# select anytest('world');
anytest
---------
f
(1 row)

any help is appreciated.

regards,
Zy

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2008-07-15 11:30:56 Re: how to found a variable is in a aggregation or not?
Previous Message justin 2008-07-15 10:37:33 Re: FAQ correction for Windows 2000/XP