Thread: Warning when selecting column from pg_stat_user_tables.

Warning when selecting column from pg_stat_user_tables.

From
Chris Barnes
Date:
 
I have this error when selecting from the pg_stat_user_tables. I restarted postgres and the error went away.
 
Has anyone else seen this error?
 
Chris Barnes
 
[postgres@preventdb02 londiste]$ cat /data/pgsql/data/pg_log/postgresql-Tue.log
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
ERROR:  missing FROM-clause entry for table "schemaname" at character 8
STATEMENT:  select schemaname.relname from pg_stat_user_tables where relname like 't0050%';
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
WARNING:  pgstat wait timeout
FATAL:  no pg_hba.conf entry for host "[local]", user "sudo", database "pgdb001", SSL off
LOG:  received fast shutdown request
LOG:  aborting any active transactions
FATAL:  terminating connection due to administrator command
LOG:  shutting down
LOG:  database system is shut down
LOG:  database system was shut down at 2010-02-09 08:46:26 EST
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

 
 
pgdb001=# select * from pg_stat_user_tables where relname like 't0050%';
WARNING:  pgstat wait timeout
 relid | schemaname |     relname     | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_t
up | last_vacuum | last_autovacuum | last_analyze | last_autoanalyze
-------+------------+-----------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+---------
---+-------------+-----------------+--------------+------------------
 16516 | dbprc001   | t0050instrument |        0 |            0 |        0 |             0 |         0 |         0 |         0 |             0 |          0 |        
 0 |             |                 |              |
(1 row)


[postgres@preventdb02 londiste]$ psql
psql (8.4.2)
Type "help" for help.
postgres=# \q



All your Hotmail contacts on your phone. Try it now.

Re: Warning when selecting column from pg_stat_user_tables.

From
Richard Huxton
Date:
On 09/02/10 13:52, Chris Barnes wrote:
>
> I have this error when selecting from the pg_stat_user_tables. I
> restarted postgres and the error went away.
>
> Has anyone else seen this error?
>
> Chris Barnes
>
>
> [postgres@preventdb02 londiste]$ cat
> /data/pgsql/data/pg_log/postgresql-Tue.log
>
> WARNING:  pgstat wait timeout
 > WARNING:  pgstat wait timeout

No, but I can tell you (roughly) what it is. The stats collector is a
separate process, and it's designed to drop messages if it gets busy.
Normally, that would be details of updates being discarded, but in this
case it's presumably your read request that gets thrown away.

If it occurs again, check "top" and see if the stats collector looks busy.

--
   Richard Huxton
   Archonet Ltd

Re: Warning when selecting column from pg_stat_user_tables.

From
Greg Smith
Date:
Chris Barnes wrote:
>
> I have this error when selecting from the pg_stat_user_tables. I
> restarted postgres and the error went away.
> Has anyone else seen this error?
> [postgres@preventdb02 londiste]$ cat
> /data/pgsql/data/pg_log/postgresql-Tue.log
> WARNING:  pgstat wait timeout

There have been periodic reports of these wait timeouts messing with the
statistics results returned by the database for a while now; some examples:

http://archives.postgresql.org/pgsql-bugs/2009-07/msg00081.php
http://archives.postgresql.org/pgsql-bugs/2009-12/msg00175.php

I just ran into one of the myself recently, wasn't able to reproduce
though.  There seems to be something subtle going wrong in statistics
collection, nobody seems exactly sure what it is yet though.

I wouldn't get stressed about it unless these become frequent, in which
case we'd probably want to ask you to collect more data about your
system to try and catch more information about one of them when it shows up.

--
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com