postgres=#
create or replace procedure print()
as $$
begin
raise notice 'ahoj';
end;
$$ language plpgsql;
CREATE PROCEDURE
postgres=#
create or replace function test()
returns void as $$
begin
call print();
return;
end;
$$ language plpgsql;
CREATE FUNCTION
postgres=# select test();
NOTICE: Found ()
CONTEXT: PL/pgSQL function "test" line 4456553 at CALL
NOTICE: OID: 16821
CONTEXT: PL/pgSQL function "test" line 4456553 at CALL
NOTICE: ahoj
CONTEXT: PL/pgSQL function "test" line 4456553 at CALL
test
------
(1 row)
postgres=# \df print
List of functions
Schema | Name | Result data type | Argument data types
--------+-------+------------------+---------------------
public | print | procedure |
(1 row)
There is lot of work still, but first step is done.
Is this different then the PL/pgPSM and do you expect these changes to make it to 8.4?
ReplyDeleteI hope, so this feature will be part of 8.4. There will be only small or none differences between plpgsql and plpgpsm (about procedure's possibilities). Current PL/pgPSM doesn't support procedures too.
ReplyDelete