Trivadis / pgbasenv

pgBasEnv - PostgreSQL Base Environment Tool

Home Page:https://github.com/Trivadis/pgbasenv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query error in pgsetenv.sh for PostgreSQL version 10

rolandstirnimann opened this issue · comments

The following query error is shown when pgsetenv.sh is executed for an instance of version 10.x.

Cluster data directories:
┌────────────┬───────┬──────┬───────┬─────────┬───────┬────────────────────────────────────┬──────────────────┬────────────────┐
│ALIAS       │   VER │ STAT │  PORT │     PID │  SIZE │ PGDATA                             │       LAST START │ LAST START HOME│
├────────────┼───────┼──────┼───────┼─────────┼───────┼────────────────────────────────────┼──────────────────┼────────────────┤
│mpdstower01 │    10 │   UP │  5432 │    7549 │   39M │ /u01/app/postgres/mpdstower01/data │ 2021-05-26 21:07 │ /usr/pgsql-10  │
└────────────┴───────┴──────┴───────┴─────────┴───────┴────────────────────────────────────┴──────────────────┴────────────────┘


ERROR:  column "sender_host" does not exist
LINE 1: select 'stb_status:'||sender_host||'|'||sender_port||'|'||st...


---[mpdstower01]:

I think it origins from the following query:

pg01:/var/lib/pgsql/tvdtoolbox/pgbasenv/bin [hr]$ pwd
/var/lib/pgsql/tvdtoolbox/pgbasenv/bin

pg01:/var/lib/pgsql/tvdtoolbox/pgbasenv/bin [hr]$ grep -i sender_host *
pgsetenv.sh:select 'stb_status:'||sender_host||'|'||sender_port||'|'||status from pg_stat_wal_receiver;

Tested with the new version 1.6 and it works. Thank you!

Last login: Thu May 27 13:29:48 CEST 2021 on pts/1

pgBasEnv v1.6 by Trivadis AG

Installation homes:
┌────────┬─────────┬─────────────────┬──────────────┐
│ALIAS   │     VER │         OPTIONS │ HOME DIR     │
├────────┼─────────┼─────────────────┼──────────────┤
│pgh1017 │   10.17 │       ssl:1G:8K │ /usr/pgsql-10│
└────────┴─────────┴─────────────────┴──────────────┘

Cluster data directories:
┌────────────┬───────┬──────┬───────┬─────────┬───────┬────────────────────────────────────┬──────────────────┬────────────────┐
│ALIAS       │   VER │ STAT │  PORT │     PID │  SIZE │ PGDATA                             │       LAST START │ LAST START HOME│
├────────────┼───────┼──────┼───────┼─────────┼───────┼────────────────────────────────────┼──────────────────┼────────────────┤
│mpdstower01 │    10 │   UP │  5432 │    2637 │   79M │ /u01/app/postgres/mpdstower01/data │ 2021-05-27 12:42 │ /usr/pgsql-10  │
└────────────┴───────┴──────┴───────┴─────────┴───────┴────────────────────────────────────┴──────────────────┴────────────────┘


---[mpdstower01]:

              Cluster name: mpdstower01
         Installation home: /usr/pgsql-10
    Cluster data directory: /u01/app/postgres/mpdstower01/data
              Cluster port: 5432
            Cluster status: UP
           Cluster version: 10
        Cluster start time: 2021-05-27 12:42
   Size of all tablespaces: 30MB
      Cluster archive mode: always
               Cluster age: 12
         Autovacuum status: ACTIVE
         Cluster databases: postgres,tower,template1,template0

---[27.05.2021 13:30]