Re: Records Number - Mailing list pgsql-general

From Richard Huxton
Subject Re: Records Number
Date
Msg-id 49BF96FA.3020905@archonet.com
Whole thread Raw
In response to Records Number  (Enrico Pirozzi <sscotty71@gmail.com>)
Responses Re: Records Number  (Enrico Pirozzi <sscotty71@gmail.com>)
Re: Records Number  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Enrico Pirozzi wrote:
> and i would like to retrieve the number of records without make
>
> select count(*) from table
>
> I could use directly the table instead of select, and in this this
> case I'm searching for
> something like the reltuples field in the pg_class table, but I need
> this value in real time.

If you want an accurate, up-to-date count then you'll need to use
count(*) or have a trigger keep a summary-count for you. A simple
implementation will reduce concurrency to writes on that table however.
Lots of discussion in the mailing-list archives on this.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Neanderthelle Jones
Date:
Subject: Escaping special characters
Next
From: Thom Brown
Date:
Subject: Re: Escaping special characters