Re: record datatype comparisons

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: record datatype comparisons
Date: 2006-10-31 21:22:53
Message-ID: 20061031212253.GD20809@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)crankycanuck(dot)ca
Everything that happens in the world happens at some place.
--Jane Jacobs

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message George Pavlov 2006-10-31 21:33:25 Re: record datatype comparisons
Previous Message Andrew Sullivan 2006-10-31 21:18:24 Re: Round Numeric Type