Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 394C39FB433 for ; Tue, 31 Oct 2006 17:49:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 57731-01-7 for ; Tue, 31 Oct 2006 21:48:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fep01.ttnet.net.tr (mail.ttnet.net.tr [212.175.13.129]) by postgresql.org (Postfix) with ESMTP id E8FEF9FB4CA for ; Tue, 31 Oct 2006 17:46:51 -0400 (AST) Received: from (unknown [192.168.8.101]) by AVGW-I-3.ttnet.net.tr with smtp id 2b90_513c04c2_6929_11db_815f_001422175f4f; Tue, 31 Oct 2006 23:46:51 +0200 Received: from alamut ([85.97.15.248]) by fep01.ttnet.net.tr with ESMTP id <20061031214649.HPHV27706.fep01.ttnet.net.tr@alamut>; Tue, 31 Oct 2006 23:46:49 +0200 Received: from (dsl.dynamic859715248.ttnet.net.tr [85.97.15.248]) by AVGW-I-3.ttnet.net.tr with smtp id 2b3c_50043354_6929_11db_8b83_001422175f4f; Tue, 31 Oct 2006 23:46:49 +0200 Date: Tue, 31 Oct 2006 23:45:00 +0200 From: Volkan YAZICI To: Andrew Sullivan Cc: pgsql-sql@postgresql.org Subject: Re: record datatype comparisons Message-ID: <20061031214500.GC1911@alamut> References: <55c095e90610311135l101f6a91s433e6d7e5b90cb7c@mail.gmail.com> <8C5B026B51B6854CBE88121DBF097A8655CBDD@ehost010-33.exch010.intermedia.net> <20061031212253.GD20809@phlogiston.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061031212253.GD20809@phlogiston.dyndns.org> User-Agent: Mutt/1.4.2.1i X-NAI-Spam-Rules: 1 Rules triggered BAYES_00=-2.5 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/259 X-Sequence-Number: 26648 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.