Find one record

From: Joseph Bove <jbove(at)vetstar(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Find one record
Date: 2003-09-18 18:01:05
Message-ID: 5.1.0.14.2.20030918135557.03ab89d8@mail.vetstar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2003-09-18 18:02:10 Re: How to force an Index ?
Previous Message Josh Berkus 2003-09-18 17:53:57 Re: Find one record