From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | WIP: named and mixed notation support |
Date: | 2009-03-01 21:49:58 |
Message-ID: | 162867790903011349l70ce76eexcc81076754d6285@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 | Content-Type | Size |
---|---|---|
named_notation_20090301-01.diff.gz | application/x-gzip | 99.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2009-03-01 21:50:02 | Re: cardinality() |
Previous Message | Stephan Szabo | 2009-03-01 18:23:19 | Re: cardinality() |