Re: SELECT COUNT(*)... returns 0 ROWS - Mailing list pgsql-admin

From Tom Lane
Subject Re: SELECT COUNT(*)... returns 0 ROWS
Date
Msg-id 19924.1067635651@sss.pgh.pa.us
Whole thread Raw
In response to Re: SELECT COUNT(*)... returns 0 ROWS  (Jeff <threshar@torgo.978.org>)
Responses Re: SELECT COUNT(*)... returns 0 ROWS
List pgsql-admin
Jeff <threshar@torgo.978.org> writes:
> "PostgreSQL" <postgres@coopelesca.co.cr> wrote:
>> Why the result us CERO? the table have 1.400.000 rows!

> 1. did you remember to load data?
> 2. did someone accidentally delete the data?
> 3. are you connected to the correct db (I've panic'd before but realized
> I was on dev, not production!)?
> 4. sure that is the right table?

I'm wondering about MVCC-related conditions, which adds a couple
more questions:

5. Did you actually commit the transaction that loaded the rows?
6. Are you doing the SELECT COUNT(*) in a transaction that started
   before the data-loading transaction committed?

            regards, tom lane

pgsql-admin by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: fishing out LOG: duration lines from the logfile.
Next
From: "PostgreSQL"
Date:
Subject: Re: SELECT COUNT(*)... returns 0 ROWS