Re: returns 0 row from plpgsql function

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: zhong ming wu <mr(dot)z(dot)m(dot)wu(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: returns 0 row from plpgsql function
Date: 2010-03-20 05:06:54
Message-ID: 162867791003192206h5480501if706480acbc8c2c3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/3/20 zhong ming wu <mr(dot)z(dot)m(dot)wu(at)gmail(dot)com>:
> Dear List
>
> I use plpgsql function as a postfix mailserver look-up table.  For
> example to look up virtual email address.
> If I don't host this email address, then the function returns null.
> Because it's a 1 row of null value postfix logs a warning message.
> Although it's harmless in that postfix takes no further action to
> deliver mail, these warning messages fill up log table.
>
> How can I return 0 row from plpgsql function?

create or replace function func(...)
returns setof tablename as $$
begin
return;
end;
$$ language plpgsql;

select * from func(..);

regards
Pavel Stehule
>
> Thanks
>
> mr.wu
>
> --
> 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 S Arvind 2010-03-20 05:58:21 Locale problem
Previous Message Craig Ringer 2010-03-20 04:02:10 Re: [GENERAL] MS Access 2007 update write conflict problem & resolution