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

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: "Francisco Figueiredo Jr(dot)" <fxjrlists(at)yahoo(dot)com(dot)br>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Why select * from function doesn't work when function
Date: 2003-07-22 20:24:32
Message-ID: Pine.LNX.4.21.0307222121210.31066-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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 * from funcF();

I don't believe it is possible. Makes sense since void doesn't really make
sense in that position in the statment.

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';

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ivan 2003-07-22 20:44:30 Re: did you read my mails ?
Previous Message Hans-Jürgen Schönig 2003-07-22 20:24:28 Re: PostgreSQL 7.3.3 and Intel C compiler