Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux