Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UpnBY-0004pP-AP for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2013 22:18:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UpnBX-00034m-Qn for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2013 22:18:31 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UpnBW-00034g-R9 for pgsql-general@postgresql.org; Thu, 20 Jun 2013 22:18:30 +0000 Received: from mail-vb0-x22f.google.com ([2607:f8b0:400c:c02::22f]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UpnBU-0002fV-MQ for pgsql-general@postgresql.org; Thu, 20 Jun 2013 22:18:30 +0000 Received: by mail-vb0-f47.google.com with SMTP id x14so5200708vbb.34 for ; Thu, 20 Jun 2013 15:18:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:reply-to:to:date:organization:content-type :x-mailer:mime-version:content-transfer-encoding:x-gm-message-state; bh=pqW04U6uZRViA5mbJr0kicH6ZiKeodGEw0XyYdJTMRM=; b=DimKQhAsmYD6slaXOXSJaCy5pxNgq7bD3KLkvJLGb2XEFAFNTvlhHcYyyatj5V6XBh k+FRqB7Fx40NgmUKeAaBVs1sprWaX1rt+5itf18/m/Wx3oK3mxgehcL+Go4pou2hHuKW KJ6HeIq5XH7gQJX/5aZ+UAnMaflKqtPymcGoITdDk3fy6gSZhshUwjfsJc0vPmm6LcAn VQS5rbmXLzyQpkvsE0UD01gLomet6Ec/esE+8D1Yq7TIiQI2FK0S5/owQPObPWcwfpU7 IUMsGiZlhcketitoiAsoxJFUsY9WcEy7LnVmOtY2SpiZ8Tl3LVp0zsu8wmwg2nFsJVih BFrw== X-Received: by 10.220.76.137 with SMTP id c9mr3956621vck.48.1371766707819; Thu, 20 Jun 2013 15:18:27 -0700 (PDT) Received: from [192.168.0.14] (cpe-108-182-79-95.nyc.res.rr.com. [108.182.79.95]) by mx.google.com with ESMTPSA id sr7sm2823566vdc.2.2013.06.20.15.18.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Jun 2013 15:18:26 -0700 (PDT) Message-ID: <1371766705.15253.44.camel@localhost.localdomain> Subject: Easiest way to compare the results of two queries row by row and column by column From: Jason Long Reply-To: mailing.lists@octgsoftware.com To: pgsql-general@postgresql.org Date: Thu, 20 Jun 2013 17:18:25 -0500 Organization: OCTG Software, LLC Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4 (3.6.4-3.fc18) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnVPCFy7VHJfsT2lXSD3EHO5+eyCkeM7towCMZCsRs5BiSBBUryWzsTEAuJS9wveG91tcRa X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Can someone suggest the easiest way to compare the results from two queries to make sure they are identical? I am rewriting a large number of views and I want to make sure that nothing is changes in the results. Something like select compare_results('select * from v_old', 'select * from v_new'); I would want this to check that the row count and each row matched column by column. I am hoping someone has already written something for this... -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general