Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8C7B29FB47E for ; Tue, 31 Oct 2006 17:42:28 -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 45987-01-7 for ; Tue, 31 Oct 2006 17:42:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mis010.exch010.intermedia.net (mis010.exch010.intermedia.net [64.78.61.97]) by postgresql.org (Postfix) with ESMTP id 392E49FB7A9 for ; Tue, 31 Oct 2006 17:33:17 -0400 (AST) Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by mis010.exch010.intermedia.net with Microsoft SMTPSVC(6.0.3790.1830); Tue, 31 Oct 2006 13:31:03 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: record datatype comparisons Date: Tue, 31 Oct 2006 13:33:25 -0800 Message-ID: <8C5B026B51B6854CBE88121DBF097A8655CBFB@ehost010-33.exch010.intermedia.net> In-Reply-To: <20061031212253.GD20809@phlogiston.dyndns.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] record datatype comparisons Thread-Index: Acb9Mn95Rinb/DAwRq6hozVqGXkjlQAAQyjw From: "George Pavlov" To: "Andrew Sullivan" , X-OriginalArrivalTime: 31 Oct 2006 21:31:03.0148 (UTC) FILETIME=[DDB5DAC0:01C6FD33] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/258 X-Sequence-Number: 26647 thanks fo the reply. i was misled by pgAdmin (1.6) giving both as "record" in the datatype (i thought "row" and "?column?" were just "best guess" column headers).=20 so, if they are indeed differently shaped is there any way to make them be the same shape? note that this one also fails with the same error (one would think these are the "same shape"): select=20 (select (1,2))=20 is distinct from=20 (select (1,2))=20 ; ERROR: operator does not exist: record =3D record SQL state: 42883 Hint: No operator matches the given name and argument type(s). You may need to add explicit type casts. =20 > -----Original Message----- > From: pgsql-sql-owner@postgresql.org=20 > [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Andrew Sullivan > Sent: Tuesday, October 31, 2006 1:23 PM > To: pgsql-sql@postgresql.org > Subject: Re: [SQL] record datatype comparisons >=20 > 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? >=20 > I don't think so. Psql gives you a hint that not: >=20 > testing=3D# SELECT (1::int, 'a'::varchar); > row =20 > ------- > (1,a) > (1 row) >=20 > testing=3D# SELECT (SELECT(1::int, 'a'::varchar)); > ?column?=20 > ---------- > (1,a) > (1 row) >=20 > 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. >=20 > A >=20 > --=20 > Andrew Sullivan | ajs@crankycanuck.ca > Everything that happens in the world happens at some place. > --Jane Jacobs=20