Re: record datatype comparisons - Mailing list pgsql-sql

From Volkan YAZICI
Subject Re: record datatype comparisons
Date
Msg-id 20061031214500.GC1911@alamut
Whole thread Raw
In response to Re: record datatype comparisons  (Andrew Sullivan <ajs@crankycanuck.ca>)
Responses Re: record datatype comparisons
List pgsql-sql
On Oct 31 04:22, Andrew Sullivan wrote:
> 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.

Can you be more verbose please? I couldn't understand what you mean with
"shape". AFAIK, both above queries should return same TupleDesc, which I
think means they should share same "shape". I don't have an idea about
the row comparison internals, but I still cannot see a reason for the
difference of returned types. I'd be appreciated if you can clarify the
explanation a little bit.


Regards.


pgsql-sql by date:

Previous
From: "George Pavlov"
Date:
Subject: Re: record datatype comparisons
Next
From: Alvaro Herrera
Date:
Subject: Re: record datatype comparisons