WIP: named and mixed notation support - Mailing list pgsql-hackers

From Pavel Stehule
Subject WIP: named and mixed notation support
Date
Msg-id 162867790903011349l70ce76eexcc81076754d6285@mail.gmail.com
Whole thread Raw
Responses Re: WIP: named and mixed notation support
List pgsql-hackers
Hello

Attachment contains patch for support mixed and named notation with
special (PostgreSQL) syntax as was talked before.

postgres=# create function dfunc(a int, b int = 1, c int) returns
table (a int, b int, c int) as $$
  select $1, $2, $3;
$$ language sql;
CREATE FUNCTION
postgres=# select * from dfunc(10,20,30);
 a  | b  | c
----+----+----
 10 | 20 | 30
(1 row)

postgres=# select * from dfunc(10 as a, 30 as c);
 a  | b | c
----+---+----
 10 | 1 | 30
(1 row)

postgres=# select * from dfunc(30 as c, 10 as a);
 a  | b | c
----+---+----
 10 | 1 | 30
(1 row)

postgres=# select * from dfunc(10, 30 as c);
 a  | b | c
----+---+----
 10 | 1 | 30
(1 row)

postgres=#

this patch is bigger, because I had to add column to pg_proc - colum
contains map of defaults arguments:

postgres=# select * from pg_proc where proname='dfunc';
-[ RECORD 1
]----+-------------------------------------------------------------------------------------------------------------------------------------
proname          | dfunc
pronamespace     | 2200
proowner         | 16384
prolang          | 14
procost          | 100
prorows          | 1000
provariadic      | 0
proisagg         | f
proiswindow      | f
prosecdef        | f
proisstrict      | f
proretset        | t
provolatile      | v
pronargs         | 3
pronpargdefaults | 0
prorettype       | 2249
proargtypes      | 23 23 23
proallargtypes   | {23,23,23,23,23,23}
proargmodes      | {i,i,i,t,t,t}
proargnames      | {a,b,c,a,b,c}
proargdefaults   | (<> {CONST :consttype 23 :consttypmod -1 :constlen
4 :constbyval true :constisnull false :location 37 :constvalue 4 [ 1 0
0 0 ]} <>)
proargdefmap     | {n,d,n}
prosrc           |
                 :   select $1, $2, $3;
                 :
probin           |
proconfig        |
proacl           |

regards
Pavel Stehule

Attachment

pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: cardinality()
Next
From: Peter Eisentraut
Date:
Subject: Re: cardinality()