Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 654AA9FB3F2 for ; Tue, 31 Oct 2006 17:23:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 33447-07 for ; Tue, 31 Oct 2006 17:23:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id EDA859FB3EE for ; Tue, 31 Oct 2006 17:22:59 -0400 (AST) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1Gf14D-00012G-6A for pgsql-sql@postgresql.org; Tue, 31 Oct 2006 16:22:41 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 4688C4051; Tue, 31 Oct 2006 16:22:53 -0500 (EST) Date: Tue, 31 Oct 2006 16:22:53 -0500 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: record datatype comparisons Message-ID: <20061031212253.GD20809@phlogiston.dyndns.org> References: <55c095e90610311135l101f6a91s433e6d7e5b90cb7c@mail.gmail.com> <8C5B026B51B6854CBE88121DBF097A8655CBDD@ehost010-33.exch010.intermedia.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8C5B026B51B6854CBE88121DBF097A8655CBDD@ehost010-33.exch010.intermedia.net> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/257 X-Sequence-Number: 26646 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. A -- Andrew Sullivan | ajs@crankycanuck.ca Everything that happens in the world happens at some place. --Jane Jacobs