Re: Why select * from function doesn't work when function - Mailing list pgsql-hackers

From Francisco Figueiredo Jr.
Subject Re: Why select * from function doesn't work when function
Date
Msg-id 3F1D966D.8010200@yahoo.com.br
Whole thread Raw
In response to Re: Why select * from function doesn't work when function  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Responses Re: Why select * from function doesn't work when function  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
List 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



pgsql-hackers by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: Why select * from function doesn't work when function
Next
From: Andrew Sullivan
Date:
Subject: Re: Criteria for contrib/ versus gborg?