--On Montag, August 03, 2009 23:43:08 +0200 Bernd Helmle <maili...@oopsware.de> wrote:

Status Report: I will finish documentation and review tomorrow and will
mark this patch for committer review.

Here's my latest reviewed version of Pavel's patch with adjusted documentation per latest discussion.

While poking a little bit with simplify_function() I realized that this patch changes the behavior of VARIADIC functions a little bit. For example:

CREATE OR REPLACE FUNCTION my_test(a IN text, txt VARIADIC text[])
RETURNS text
AS
$$
  SELECT $2[1];
$$ LANGUAGE SQL;

The following doesn't work in current 8.4:

SELECT my_test('abcd', ARRAY['test', 'foo']);

You need to use the VARIADIC keyword to match the second argument to text[]. However, if you are going to use named notation with the patch applied, the picture changes in HEAD:

SELECT my_test('abcd' AS a, ARRAY['test', 'foo'] AS txt);
my_test
---------
test
(1 row)

This applies also when you reverse the argument order. I don't know wether this is intended, but its conflicting with what we have currently in the docs. It's also not clear to me wether we want this at all.

--
 Thanks

                   Bernd

Attachment: named_and_mixed_notation_review3.patch.gz
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to