3

Given the two definitions below, is there any difference?

CREATE FUNCTION foo(OUT foobar int4)
RETURNS SETOF int4
AS 'MODULE_PATHNAME', 'foo'
LANGUAGE C STRICT VOLATILE;

And,

CREATE FUNCTION foo()
RETURNS TABLE(foobar int4)
AS 'MODULE_PATHNAME', 'foo'
LANGUAGE C STRICT VOLATILE;

That is to say is there a difference between the "Result data type" as displayed with \df between

  • TABLE(foobar integer)
  • and, SETOF interger where the Argument data types includes OUT foobar integer

1 Answer 1

3

The docs say this on CREATE FUNCTION

The name of an output column in the RETURNS TABLE syntax. This is effectively another way of declaring a named OUT parameter, except that RETURNS TABLE also implies RETURNS SETOF.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.