Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B4EAC1337B58 for ; Tue, 12 Oct 2010 17:58:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 59980-07 for ; Tue, 12 Oct 2010 20:58:27 +0000 (UTC) X-Greylist: delayed 00:40:38.345777 by SQLgrey-1.7.6 Received: from benix.tamu.edu (ben.tamu.edu [165.91.232.129]) by mail.postgresql.org (Postfix) with ESMTP id 2DF8C1337B50 for ; Tue, 12 Oct 2010 17:58:27 -0300 (ADT) Received: from benix.tamu.edu (localhost.localdomain [127.0.0.1]) by benix.tamu.edu (8.14.4/8.14.3) with ESMTP id o9CKHl8j000729 for ; Tue, 12 Oct 2010 15:17:47 -0500 Received: (from bkim@localhost) by benix.tamu.edu (8.14.4/8.14.4/Submit) id o9CKHlWe000727 for pgsql-admin@postgresql.org; Tue, 12 Oct 2010 15:17:47 -0500 Date: Tue, 12 Oct 2010 15:17:47 -0500 From: Ben Kim To: pgsql-admin@postgresql.org Subject: compare two rows Message-ID: <20101012201747.GA720@tamu.edu> References: <4CB479DB02000025000368A9@gw.wicourts.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CB479DB02000025000368A9@gw.wicourts.gov> User-Agent: Mutt/1.5.20 (2009-12-10) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/99 X-Sequence-Number: 35840 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