pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: frank.buettner@mdc-berlin.de
Subject: BUG #15493: Wrong name of fields/missing fields for the internal statistic
Date: Thu, 08 Nov 2018 14:11:14 +0000
Message-ID: <15493-c69664b13991e9b6@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15493
Logged by:          - -
Email address:      frank.buettner@mdc-berlin.de
PostgreSQL version: 11.0
Operating system:   CentOS 7.5
Description:        

How to produce:
- Simple install pgsql 11 on CentOS from yum repo of postgresql.org
- init the cluster
- start the server
- wait some time

After some times, many errors are logged about not existing fields.
< 2018-11-08 14:21:59.820 CET >ERROR:  column "procpid" does not exist at
character 132
< 2018-11-08 14:21:59.820 CET >STATEMENT:  SELECT datname, datid, usename,
client_addr, '' AS state,    COALESCE(ROUND(EXTRACT(epoch FROM
now()-query_start)),0) AS seconds,
         procpid as pid, regexp_replace(current_query, E'[\n\r\u2028]+', '
', 'g' ) AS current_query FROM pg_stat_activity WHERE (query_start IS NOT
NULL AND current_query NOT LIKE '<IDLE>%') ORDER BY query_start, procpid
DESC;
< 2018-11-08 14:22:00.117 CET >ERROR:  column "current_query" does not exist
at character 200
< 2018-11-08 14:22:00.117 CET >STATEMENT:  SELECT COUNT(datid) AS current,
          (SELECT setting AS mc FROM pg_settings WHERE name =
'max_connections') AS mc,
          d.datname
        FROM pg_database d
        LEFT JOIN pg_stat_activity s ON (s.datid = d.oid) WHERE
current_query <> '<IDLE>'
        GROUP BY 2,3
        ORDER BY datname

When I look in the database I can see, that the field has other name:
postgres=# \d+ pg_stat_activity
                                  View "pg_catalog.pg_stat_activity"
      Column      |           Type           | Collation | Nullable |
Default | Storage  | Description 
------------------+--------------------------+-----------+----------+---------+----------+-------------
 datid            | oid                      |           |          |       
 | plain    | 
 datname          | name                     |           |          |       
 | plain    | 
 pid              | integer                  |           |          |       
 | plain    | 

And pg_settings has no column current_query:
postgres=# \d+ pg_settings     
                            View "pg_catalog.pg_settings"
     Column      |  Type   | Collation | Nullable | Default | Storage  |
Description 
-----------------+---------+-----------+----------+---------+----------+-------------
 name            | text    |           |          |         | extended | 
 setting         | text    |           |          |         | extended | 
 unit            | text    |           |          |         | extended | 
 category        | text    |           |          |         | extended | 
 short_desc      | text    |           |          |         | extended | 
 extra_desc      | text    |           |          |         | extended | 
 context         | text    |           |          |         | extended | 
 vartype         | text    |           |          |         | extended | 
 source          | text    |           |          |         | extended | 
 min_val         | text    |           |          |         | extended | 
 max_val         | text    |           |          |         | extended | 
 enumvals        | text[]  |           |          |         | extended | 
 boot_val        | text    |           |          |         | extended | 
 reset_val       | text    |           |          |         | extended | 
 sourcefile      | text    |           |          |         | extended | 
 sourceline      | integer |           |          |         | plain    | 
 pending_restart | boolean |           |          |         | plain    |



view thread (4+ messages)  latest in thread

Message-ID: <15493-c69664b13991e9b6@postgresql.org>
Permalink:  ../15493-c69664b13991e9b6@postgresql.org/
Also on:    postgresql.org/message-id/15493-c69664b13991e9b6@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, frank.buettner@mdc-berlin.de
  Subject: Re: BUG #15493: Wrong name of fields/missing fields for the internal statistic
  In-Reply-To: <15493-c69664b13991e9b6@postgresql.org>
  References: <15493-c69664b13991e9b6@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox