Re: pg_stat_reset round 3

From: Joe Conway <mail(at)joeconway(dot)com>
To: Alvaro Herrera <alvherre(at)atentus(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pg_stat_reset round 3
Date: 2002-08-06 06:39:19
Message-ID: 3D4F6F17.4030805@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Alvaro Herrera wrote:
> Christopher Kings-Lynne dijo:
>
>
>>>Interesting that all callable function must return a type. I did:
>>>
>>> test=> select proname from pg_proc where prorettype = 0;
>>>
>>>and none of the functions with 0 prorettype can be called from psql. I
>>>guess boolean is the best we can do. I guess because it is a function
>>>it has to return something.
>>
>>Yeah, because otherwise what does the SELECT return? It has to return at
>>least one column? It would be odd to just go SELECT blah() and have the
>>prompt just come back to you. However, it would be nice to be able to go
>>"CALL blah()" and have it return nothing except maybe a 'CALL' string.
>
>
> What's so bad about returning a SQL NULL in SELECT ? Seems an arbitrary
> limitation to me.
>

Functions can return NULL, just not void.

The CALL syntax Chris is referring to is for Procedures, which we have
not implemented yet (but I'd love to see us do it). Procedures return
nothing. They have side efects only. Well, actually, in other DBs there
are OUT parameters which allow procedures to return values in a limited
way. And in MSSQL (at least) they can project result sets, which is not
the same as returning result sets because you can't do anything with
them like apply a criteria or join with other results.

Joe

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tatsuo Ishii 2002-08-06 06:57:35 Re: SQL99 CONVERT() function
Previous Message Bruce Momjian 2002-08-06 06:26:05 Re: small psql patch - show Schema name for \dt \dv \dS