Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id BB31A9FBBDB for ; Thu, 17 May 2007 10:38:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 65298-05-2 for ; Thu, 17 May 2007 10:38:01 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web31807.mail.mud.yahoo.com (web31807.mail.mud.yahoo.com [68.142.207.70]) by postgresql.org (Postfix) with SMTP id 7AFB09FBAA0 for ; Thu, 17 May 2007 10:38:29 -0300 (ADT) Received: (qmail 38141 invoked by uid 60001); 17 May 2007 13:38:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=vviCX4uyzvhHPr+l0NnFoXUSEkc/bb0l2M0mQ3R1iOUVBISmjamb4UvUBWxrtdArB+Hezds2WbKklhl3VbhVn3H+7zyN2J50RfvxXXj/x5EMs22qMaQQu9B5Q4WS7JC4d4lsiFvbu2U029UnGD/4Cwkt6tIJy+DkQgZeimZ8k4g=; X-YMail-OSG: lSBqjDkVM1ldXdfsoWlOid9SZSHwIr6MbhHX5CgxZ7aLgVhKbHWE9AHakRFrbgGoOER6hakwwCKcs6ReDebreSJ.lPjKMOlD1cIDTuRtZDkdVzlp6vq8KPg6dm8dpg-- Received: from [63.203.180.122] by web31807.mail.mud.yahoo.com via HTTP; Thu, 17 May 2007 06:38:26 PDT Date: Thu, 17 May 2007 06:38:26 -0700 (PDT) From: Richard Broersma Jr Subject: Re: Whole-row comparison ? To: christian.roche.ext@nsn.com, pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <457481.33047.qm@web31807.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.735 tagged_above=0 required=5 tests=AWL=-0.021, BAYES_00=-2.599, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447 X-Spam-Level: X-Archive-Number: 200705/138 X-Sequence-Number: 28418 > So my question is: is there a way to do some kind of whole-row > comparison ? For instance a hash of the full row or something similar ? > Is there a standard way of solving this problem ? Sure it is called row wise comparison: http://www.postgresql.org/docs/8.2/interactive/functions-comparisons.html#ROW-WISE-COMPARISON you can write something like: SELECT * FROM Your_table WHERE (c1,c2,c3,c4) = ('a',2,'xyz',123); Regards, Richard Broersma Jr.