default parameters for PL functions
I completed one task - defaults for PL functions. Using is simple - it is same as Firebird's 2.x defaults.
postgres=# create or replace function x1(int = 1,int = 2,int= 3)This is first step before named parameters feature - and less controversy. Second step will be difficult - there are two opinions about named parameter's syntax: variant a) using Oracle's syntax
returns int as $$
$$ language sql;
postgres=# select x1();
postgres=# select x1(10);;
postgres=# select x1(10,20);
postgres=# select x1(10,20,30);
name => expressionand variant b) use own syntax based on keyword "AS"
expression AS name. I prefer variant @a - I thing so it's more readable (SQL use AS for labeling). Variant @b is safe from compatibility views. There was discussion on pg_hackers - without any conclusion. So I hope so at least defaults will be committed.