Re: Excluding null return values from functions

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Jason Armstrong <ja(at)riverdrums(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Excluding null return values from functions
Date: 2009-11-25 12:03:56
Message-ID: 162867790911250403i7f730624qc52e493e39fd60dc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/11/25 Jason Armstrong <ja(at)riverdrums(dot)com>:
> How do I give a condition on the return value of a function (for
> example plperl)?
>
> I have a perl search function that returns either a bigint, or undef
> if nothing is found. I want to exclude the undef/null return values
> from my select statement, something like:
>
> sql> select search(data, 'field', 'value') as result from mydata where
> result is not null;

select result from (select search(data, 'field','value') as result
from mydata) x where result is not null;

regards
Pavel Stehule

>
> --
> Jason Armstrong
>
> --
> 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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John Oyler 2009-11-25 13:07:17 Re: Re: I need help creating a composite type with some sort of constraints.
Previous Message Jason Armstrong 2009-11-25 11:59:19 Excluding null return values from functions