Re: Whole-row comparison ? - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: Whole-row comparison ?
Date
Msg-id 473557.7523.qm@web31803.mail.mud.yahoo.com
Whole thread Raw
In response to Whole-row comparison ?  (<christian.roche.ext@nsn.com>)
Responses Re: Whole-row comparison ?  (<christian.roche.ext@nsn.com>)
List pgsql-sql
--- christian.roche.ext@nsn.com wrote:
> select * from temp."BSC_Table" t, public.bsc_view p where t.id = p.id
> and row(t) <> row(p);
> 
> ERROR: operator does not exist: "temp"."BSC_Table" <> bsc_view
> SQL state: 42883
> Hint: No operator matches the given name and argument type(s). You may
> need to add explicit type casts.
> 

Don't forget to reply all so that everyone on the list can participate.  Also, do this is good
since it doesn't limit you to my limited knowledge. ;)

row() doesn't do what you think it does.

you have to specify every column that you want to compare, so:

row(t.col1, t.col2, t.col3, t.col4) <> row(p.col1, p.col2, p.col3, p.col4)

where the datatypes of each respective column match. i.e. t.col1 maps to p.col1, ...

Regards,
Richard Broersma Jr.


pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Whole-row comparison ?
Next
From:
Date:
Subject: Re: Whole-row comparison ?