From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Proposal: casts row to array and array to row |
Date: | 2011-10-11 08:40:26 |
Message-ID: | CAFj8pRBOUc8Y2f7qnENCuNFjmC1wwS5z_GpQwWv5OLWqmV=Bvw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
A current limits of dynamic work with row types in PL/pgSQL can be
decreased with a possible casts between rows and arrays. Now we have a
lot of tools for arrays, and these tools should be used for rows too.
postgres=# \d mypoint
Composite type "public.mypoint"
Column │ Type │ Modifiers
────────┼─────────┼───────────
a │ integer │
b │ integer │
postgres=# select cast(rmypoint '(10,20) as int[]);
array
────────────
{10,20}
(1 row)
postgres=# select cast(ARRAY[10,20] AS mypoint);
mypoint
─────────
(10,20)
(1 row)
What do you think about this idea?
Regards
Pavel Stehule
From | Date | Subject | |
---|---|---|---|
Next Message | Jun Ishiduka | 2011-10-11 10:15:54 | Re: Online base backup from the hot-standby |
Previous Message | Kyotaro HORIGUCHI | 2011-10-11 07:55:00 | Re: [v9.2] make_greater_string() does not return a string in some cases |