Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 323891337B50 for ; Tue, 12 Oct 2010 18:11:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 78859-04-4 for ; Tue, 12 Oct 2010 21:11:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id E4F3A1337C20 for ; Tue, 12 Oct 2010 18:11:18 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9CLBHRh006901; Tue, 12 Oct 2010 17:11:18 -0400 (EDT) To: Ben Kim cc: pgsql-admin@postgresql.org Subject: Re: compare two rows In-reply-to: <20101012201747.GA720@tamu.edu> References: <4CB479DB02000025000368A9@gw.wicourts.gov> <20101012201747.GA720@tamu.edu> Comments: In-reply-to Ben Kim message dated "Tue, 12 Oct 2010 15:17:47 -0500" Date: Tue, 12 Oct 2010 17:11:17 -0400 Message-ID: <6900.1286917877@sss.pgh.pa.us> From: Tom Lane 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/100 X-Sequence-Number: 35841 Ben Kim writes: > What is the best way to compare two rows from within psql cli client? In 8.4 and up you can just compare the row values, eg select x.* = y.* if x and y are known to be of the same rowtype. regards, tom lane