Re: Whole-row comparison ?

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: christian(dot)roche(dot)ext(at)nsn(dot)com
Cc: SQL Postgresql List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Whole-row comparison ?
Date: 2007-05-17 17:20:35
Message-ID: 473557.7523.qm@web31803.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


--- christian(dot)roche(dot)ext(at)nsn(dot)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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message christian.roche.ext 2007-05-17 18:00:47 Re: Whole-row comparison ?
Previous Message Richard Broersma Jr 2007-05-17 13:38:26 Re: Whole-row comparison ?