pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ben Kim <bkim@tamu.edu>
To: pgsql-admin@postgresql.org
Subject: compare two rows
Date: Tue, 12 Oct 2010 15:17:47 -0500
Message-ID: <20101012201747.GA720@tamu.edu> (raw)
In-Reply-To: <4CB479DB02000025000368A9@gw.wicourts.gov>
References: <AANLkTimX4BNmUm7KJ72FUBu+FgcKDxZdMcK4FkTfOmwA@mail.gmail.com>
	<4CB479DB02000025000368A9@gw.wicourts.gov>

Admins,

What is the best way to compare two rows from within psql cli client? 

It has ~30 fields, and the two rows are duplicate data but there might
be differences.

id field1  field2  field3 ...
===========================
id1 value1 value2 value3  ...
id2 value1 value2 value3  ...

I could write a generic script to iterate through the list of fields and
compare each field values, or concatenate the fields to a string, but wondered what is out there.

Also, is there a way around to use select row(...) = row(...)?


Thanks.
-- 
Ben Kim



view thread (7+ messages)  latest in thread

Message-ID: <20101012201747.GA720@tamu.edu>
Permalink:  ../20101012201747.GA720@tamu.edu/
Also on:    postgresql.org/message-id/20101012201747.GA720@tamu.edu

 · 

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-admin@postgresql.org
  Cc: bkim@tamu.edu
  Subject: Re: compare two rows
  In-Reply-To: <20101012201747.GA720@tamu.edu>

* 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