Re: record datatype comparisons - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: record datatype comparisons
Date
Msg-id 20061031212253.GD20809@phlogiston.dyndns.org
Whole thread Raw
In response to record datatype comparisons  ("George Pavlov" <gpavlov@mynewplace.com>)
Responses Re: record datatype comparisons  ("George Pavlov" <gpavlov@mynewplace.com>)
Re: record datatype comparisons  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
List 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@crankycanuck.ca
Everything that happens in the world happens at some place.    --Jane Jacobs 


pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Round Numeric Type
Next
From: "George Pavlov"
Date:
Subject: Re: record datatype comparisons