pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: Volkan YAZICI <yazicivo@ttnet.net.tr>
Cc: George Pavlov <gpavlov@mynewplace.com>
Cc: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: record datatype comparisons
Date: Wed, 1 Nov 2006 09:32:35 -0500
Message-ID: <20061101143235.GB25856@phlogiston.dyndns.org> (raw)
In-Reply-To: <20061031215808.GD1911@alamut>
References: <20061031212253.GD20809@phlogiston.dyndns.org>
	<8C5B026B51B6854CBE88121DBF097A8655CBFB@ehost010-33.exch010.intermedia.net>
	<20061031214927.GF12008@alvh.no-ip.org>
	<20061031215808.GD1911@alamut>

On Tue, Oct 31, 2006 at 11:58:08PM +0200, Volkan YAZICI wrote:
> On Oct 31 06:49, Alvaro Herrera wrote:
> > > select 
> > >   (select (1,2)) 
> > > is distinct from 
> > >   (select (1,2)) 
> > > ;

> > alvherre=# select
> >   row(1,2)
> > is distinct from
> >   row(1,2)
> 
> What's the difference between "SELECT (1, 2);" and "SELECT ROW(1, 2);"?

It's not the difference between SELECT (1,2) and SELECT ROW(1,2)
that's relevant, but the difference between SELECT (SELECT (1,2)) and
SELECT ROW(1,2).  

The row's datatype(s) is(are) defined.  The record's datatype isn't. 
So you can have an equality operator for the row.  You can see this
from the error message when you do this:

testing=# SELECT ROW(1,2) is distinct from ROW ('a','b');
ERROR:  invalid input syntax for integer: "a"

This is part of the subtle difference between the record and row
datatypes.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The plural of anecdote is not data.
		--Roger Brinner



view thread (10+ messages)  latest in thread

Message-ID: <20061101143235.GB25856@phlogiston.dyndns.org>
Permalink:  ../20061101143235.GB25856@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20061101143235.GB25856@phlogiston.dyndns.org

 · 

reply

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, yazicivo@ttnet.net.tr, gpavlov@mynewplace.com
  Subject: Re: record datatype comparisons
  In-Reply-To: <20061101143235.GB25856@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