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

2003-07-25 Thread Francisco Figueiredo Jr.
Nigel J. Andrews wrote: On Thu, 24 Jul 2003, Francisco Figueiredo Jr. wrote: Nigel J. Andrews wrote: On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote: How's this for an alternative if you really don't want any rows returned: create function fincF ( ) returns setof integer as ' begin d

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

2003-07-25 Thread Francisco Figueiredo Jr.
Tom Lane wrote: "Francisco Figueiredo Jr." <[EMAIL PROTECTED]> writes: I just wanted void functions behave like others when called as select * from voidfunction So I dont have to do select voidfunction. :) It's not only void functions that fail --- I believe the code will reject any pseudo-ty

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

2003-07-24 Thread Nigel J. Andrews
On Thu, 24 Jul 2003, Francisco Figueiredo Jr. wrote: > Nigel J. Andrews wrote: > > > On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote: > > > > > >>>How's this for an alternative if you really don't want any rows returned: > >>> > >>>create function fincF ( ) returns setof integer as ' > >>>

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

2003-07-24 Thread Tom Lane
"Francisco Figueiredo Jr." <[EMAIL PROTECTED]> writes: > I just wanted void functions behave like others when called as select * > from voidfunction So I dont have to do select voidfunction. :) It's not only void functions that fail --- I believe the code will reject any pseudo-type, which inclu

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

2003-07-24 Thread Francisco Figueiredo Jr.
Nigel J. Andrews wrote: On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote: How's this for an alternative if you really don't want any rows returned: create function fincF ( ) returns setof integer as ' begin delete from blah; return; end; ' language 'plpgsql'; This works, but what I rea

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

2003-07-22 Thread Nigel J. Andrews
On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote: > > How's this for an alternative if you really don't want any rows returned: > > > > create function fincF ( ) returns setof integer as ' > > begin > >delete from blah; > >return; > > end; > > ' language 'plpgsql'; > > > > > > T

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

2003-07-22 Thread Francisco Figueiredo Jr.
Nigel J. Andrews wrote: On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote: select * from funcF(); Yeap, it works, but you specified integer as the return type :) Yes, that's because I knew the void wouldn't work. :] :) How's this for an alternative if you really don't want any rows return

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

2003-07-22 Thread Nigel J. Andrews
On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote: > > select * from funcF(); > > > > Yeap, it works, but you specified integer as the return type :) Yes, that's because I knew the void wouldn't work. :] > > I'd like to have the return type as void and be possible to call it with > select *

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

2003-07-22 Thread Francisco Figueiredo Jr.
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 appe

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

2003-07-22 Thread Nigel J. Andrews
On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote: > > Hi all, > > I would like to know why does calling a function with select * from > function doesn't work when its return type is set to void. > > I'm asking this because I have a code which uses this syntax to add > support for returning