X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2718DD1B50F for ; Thu, 18 Sep 2003 17:48:58 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 11582-06 for ; Thu, 18 Sep 2003 14:48:28 -0300 (ADT) Received: from merlin (merlin.warpdrive.net [24.56.130.4]) by svr1.postgresql.org (Postfix) with ESMTP id EF9DCD1B4F0 for ; Thu, 18 Sep 2003 14:48:26 -0300 (ADT) Received: from mail.warpdrive.net ([24.56.130.6] helo=mail.vetstar.com) by merlin with esmtp (Exim 4.14) id 1A02tC-0004Xf-IS for pgsql-performance@postgresql.org; Thu, 18 Sep 2003 13:48:22 -0400 Received: from sirius.vetstar.com [66.88.86.217] by mail.vetstar.com with ESMTP (SMTPD32-8.02) id AFB9385013C; Thu, 18 Sep 2003 13:47:37 -0400 Message-Id: <5.1.0.14.2.20030918135557.03ab89d8@mail.vetstar.com> X-Sender: jbove@vetstar.com@mail.vetstar.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 18 Sep 2003 14:01:05 -0400 To: pgsql-performance@postgresql.org From: Joseph Bove Subject: Find one record In-Reply-To: <200309181034.13414.josh@agliodbs.com> References: <24864010.1063897195181.JavaMail.root@statler.psp.pas.earthlink.net> <24864010.1063897195181.JavaMail.root@statler.psp.pas.earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/272 X-Sequence-Number: 3638 Dear list, I hope this to be a simple question. I have need to simply read the first row in a given table. Right now, I have some legacy code that selects all rows in a table just to see if the first row has a certain value. The code is seeking to see if an update has been run or not. A hypothetical scenario would be: has an update been run to populate data into a new column in a table. Neither the data nor any of the rows are consistently known. So the test selects all rows, tests the first row and then ends if the column has a value. Does anyone have a better way to do this? Regards