Re: Why select * from function doesn't work when function

From: "Francisco Figueiredo Jr(dot)" <fxjrlists(at)yahoo(dot)com(dot)br>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Why select * from function doesn't work when function
Date: 2003-07-22 19:54:21
Message-ID: 3F1D966D.8010200@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nigel J. Andrews wrote:

>
>
>
> Try returning an integer but returning a null for that integer...on the other
> hand I see you're using sql as the language and I don't know how that would
> work.

I tried that and it works. I changed the function body to do a query
which returns null. The problem only appears if the return type is void.

>
> Have you looked at plpgsql? Perhaps that is acceptable for you, in which case:
>
> create function funcF ( ) returns integer as '
> begin
> delete from blah;
> return null;
> end;
> ' as language 'plpgsql';
>
> select * from funcF();
>

Yeap, it works, but you specified integer as the return type :)

I'd like to have the return type as void and be possible to call it with
select * from funcF();

Thanks Nigel.

--
Regards,

Francisco Figueiredo Jr.

------
"My grandfather once told me that there are two
kinds of people: those
who work and those who take the credit. He told me
to try to be in the
first group; there was less competition there."
- Indira Gandhi

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Sullivan 2003-07-22 20:16:00 Re: Criteria for contrib/ versus gborg?
Previous Message Marcus Brger 2003-07-22 19:54:12 Re: php with postgres