Am 2012-02-23 00:42, schrieb Peter:
On 23/02/12 05:30, Matthias Leopold wrote:
how do i make a postgres plperl function return a value/row only when
certain conditions are met and otherwise return "nothing"/void/0 rows?
right now my function returns "1 row" even when i return undef.

Have you tried using your function in the WHERE clause of your SQL query?


Peter

thx for your answer.

could you give me an example of how to do this?
right now i'm calling my function like

select function('foo');
or
select * from function('foo');

actually, in the meantime i found a way to achieve my goal, although i don't think this is a very "clean" way:

the function is defined to "return setof character varying" and returns a reference to an array consisting of one element

matthias


Reply via email to