2011/10/11 Tom Lane <t...@sss.pgh.pa.us>: > Pavel Stehule <pavel.steh...@gmail.com> writes: >> 2011/10/11 Robert Haas <robertmh...@gmail.com>: >>> On Tue, Oct 11, 2011 at 4:40 AM, Pavel Stehule <pavel.steh...@gmail.com> >>> 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 - when is not >> possible to cast a row field to array field. > > This idea is basically the same as "data types don't matter", which is > not SQL-ish and certainly not Postgres-ish.
This proposal is not about this. The data types are important and I don't propose a universal data type or some automatic datatype. Result of cast op has know type defined in planner time. Proposal is more about respect to datatypes than now. A some row based operations are based on serialization and deserialization to text. This is in PLPerl or PLpgSQL, on user level or system level. When you have to do some task, then you have to solve quoting, NULL replacement, ... Casts between array and rows just remove these ugly hacks - so work can be faster and more robust (without string operations (when is possible) and without quoting string ops at least). unfortunately I am not able to solve these requests on custom functions level, because I can't to specify a target type from function (I am missing a some polymorphic type like "anytype"). Regards Pavel Stehule > > regards, tom lane > -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers