From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: record datatype comparisons
Date: Tue, 31 Oct 2006 16:22:53 -0500
Message-ID: <20061031212253.GD20809@phlogiston.dyndns.org> (raw)
In-Reply-To: <8C5B026B51B6854CBE88121DBF097A8655CBDD@ehost010-33.exch010.intermedia.net>
References: <55c095e90610311135l101f6a91s433e6d7e5b90cb7c@mail.gmail.com>
<8C5B026B51B6854CBE88121DBF097A8655CBDD@ehost010-33.exch010.intermedia.net>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ajs@crankycanuck.ca
Subject: Re: record datatype comparisons
In-Reply-To: <20061031212253.GD20809@phlogiston.dyndns.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox