Re: [HACKERS] Proposal: casts row to array and array to row

2011-11-05 Thread Noah Misch
On Tue, Oct 11, 2011 at 10:40:26AM +0200, Pavel Stehule wrote: > What do you think about this idea? +1, belatedly. Having inherent casts to/from text since version 8.3 has smoothed out some aggravating corner cases. If the patch isn't invasive and the casts are all explicit-only, I anticipate a

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-12 Thread Pavel Stehule
2011/10/11 Tom Lane : > Pavel Stehule writes: >> 2011/10/11 Robert Haas : >>> On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule >>> wrote: What do you think about this idea? > > It's a bad one. > >>> Well, a ROW can contain values of different types; an ARRAY can't. > >> yes, I know - but it s

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Merlin Moncure
On Tue, Oct 11, 2011 at 8:36 AM, Tom Lane wrote: > Pavel Stehule writes: >> 2011/10/11 Robert Haas : >>> On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule >>> wrote: What do you think about this idea? > > It's a bad one. > >>> Well, a ROW can contain values of different types; an ARRAY can't.

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Tom Lane
Pavel Stehule writes: > 2011/10/11 Robert Haas : >> On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule >> wrote: >>> What do you think about this idea? It's a bad one. >> Well, a ROW can contain values of different types; an ARRAY can't. > yes, I know - but it should be problem only in few cases

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Pavel Stehule
2011/10/11 Merlin Moncure : > On Tue, Oct 11, 2011 at 8:18 AM, Pavel Stehule > wrote: >> 2011/10/11 Merlin Moncure : >>> On Tue, Oct 11, 2011 at 3:40 AM, Pavel Stehule >>> wrote: Hello A current limits of dynamic work with row types in PL/pgSQL can be decreased with a possib

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Merlin Moncure
On Tue, Oct 11, 2011 at 8:18 AM, Pavel Stehule wrote: > 2011/10/11 Merlin Moncure : >> On Tue, Oct 11, 2011 at 3:40 AM, Pavel Stehule >> wrote: >>> 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

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Pavel Stehule
2011/10/11 Merlin Moncure : > On Tue, Oct 11, 2011 at 3:40 AM, Pavel Stehule > wrote: >> 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 u

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Merlin Moncure
On Tue, Oct 11, 2011 at 3:40 AM, Pavel Stehule wrote: > 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 my

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Pavel Stehule
2011/10/11 Boszormenyi Zoltan : > Hi, > > 2011-10-11 14:23 keltezéssel, Robert Haas írta: >> >> On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule >>  wrote: >>> >>> Hello >>> >>> A current limits of dynamic work with row types in PL/pgSQL can be >>> decreased with a possible casts between rows and arr

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Boszormenyi Zoltan
Hi, 2011-10-11 14:23 keltezéssel, Robert Haas írta: On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule wrote: 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 sh

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Pavel Stehule
> > sometimes he can use a numeric or int array, sometimes he have to > select text array. Target type is selected by user, and cast fail when > conversion is not possible. > using a some selected type (for array field) allows a processing in plpgsql. motivation for this feature is simplification

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Pavel Stehule
2011/10/11 Robert Haas : > On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule > wrote: >> 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

Re: [HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Robert Haas
On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule wrote: > 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 my

[HACKERS] Proposal: casts row to array and array to row

2011-10-11 Thread Pavel Stehule
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