On Oct 31 04:22, Andrew Sullivan wrote: > On Tue, Oct 31, 2006 at 12:38:36PM -0800, George Pavlov wrote: > > Both (1::int,'a'::varchar) and (select (2::int,'a'::varchar)) are of > > type record, aren't they? > > I don't think so. Psql gives you a hint that not: > > testing=# SELECT (1::int, 'a'::varchar); > row > ------- > (1,a) > (1 row) > > testing=# SELECT (SELECT(1::int, 'a'::varchar)); > ?column? > ---------- > (1,a) > (1 row) > > Note the column headers. They're differently shaped. Because > pseudotype record doesn't have a shape, equality doesn't make sense, > so you need two shapes that are already identical, so they can use > the matching rules for that.
Can you be more verbose please? I couldn't understand what you mean with "shape". AFAIK, both above queries should return same TupleDesc, which I think means they should share same "shape". I don't have an idea about the row comparison internals, but I still cannot see a reason for the difference of returned types. I'd be appreciated if you can clarify the explanation a little bit. Regards. ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings