Folks,
This seems wrong to me:
postgres=# create table test1 ( testy int );
CREATE TABLE
postgres=# insert into test1 values ( 5 );
INSERT 0 1
postgres=# create function void_func ( IN theval int ) returns void as $f$
postgres$# update test1 set testy = $1;
postgres$# $f$ language sql;
CREATE FUNCTION ^
postgres=# select * from void_func( 9 );void_func
-----------
(1 row)
postgres=# select void_func( 10 ) is null;?column?
----------t
(1 row)
postgres=# create function void_func2( IN theval int )
postgres-# returns void as $f$
postgres$# begin
postgres$# update test1 set testy = theval;
postgres$# return;
postgres$# end;$f$ language plpgsql;
CREATE FUNCTION
postgres=# select * from void_func2(19);void_func2
------------
(1 row)
postgres=# select void_func2(19) is null;?column?
----------f
(1 row)
Why is a function which returns void returning a row? Why is that row
NULL if it's a SQL function and empty if it's a PLPGSQL function?
(version 8.2.3)
--
--Josh
Josh Berkus
PostgreSQL @ Sun
San Francisco