pg_gather
pg_gather copied to clipboard
ERRORs while running. ERROR: syntax error at or near ":" invalid command \if invalid command \endif
A sample pg_gather (gather.sql) output is
psql:/app/gather.sql:5: ERROR: syntax error at or near ":"
LINE 1: SELECT ( :SERVER_VERSION_NUM > 120000 ) AS pg12, ( :SERVER_V...
^
psql:/app/gather.sql:7: invalid command \if
SELECT (SELECT count(*) > 1 FROM pg_srvr) AS conlines \gset
\if :conlines
\echo SOMETHING WRONG, EXITING
SOMETHING WRONG, EXITING;
\q
\endif
psql:/app/gather.sql:15: invalid command \endif
Tuples only is on.
\t
\r
psql:/app/gather.sql:27: invalid command \if
COPY pg_srvr FROM stdin;
These problems are mainly reported when data is collected from jump/bastion hosts.
These errors indicate that the psql
version is very old. you may check
psql --version
pg_gather expects a recent version of psql
Avoid installing PostgreSQL binaries from Linux repo, Highly encouraged to install PostgreSQL clients and libraries from PGDG repositories and always make sure that psql version before running the gather.sql
. A psql
version which is the same as the PostgreSQL major version is highly reccommended.
This is no a bug. So this will be never fixed