pg_gather icon indicating copy to clipboard operation
pg_gather copied to clipboard

function max(pg_lsn) does not exist

Open fernandorb10 opened this issue 2 years ago • 5 comments

Thank you very much for your work !

On the other hand, I have this error when trying to run the report.

It is normal?

Thanks.

-bash-4.2$ /usr/pgsql-11/bin/psql -X -f gather_report.sql > GatherReport.html psql:gather_report.sql:180: ERROR: function max(pg_lsn) does not exist LINE 1: ...TEST((SELECT(current_wal) FROM pg_gather),(SELECT MAX(sent_l... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

fernandorb10 avatar Jan 25 '23 14:01 fernandorb10

Hello there! I'm seeing the exact same error message (but at line 181 of the gather_report.sql file)

Running the script gather_schema.sql with the output file worked without errors.

I'm running this in ubuntu 20.04 with postgresql 12.14 installed from ubuntu packages. I haven't enabled any extensions on postgres.

postgres@ubuntu2004:/home/vagrant$ psql -X -f pg_gather/gather_report.sql > /tmp/report-2023-04-11_09-27.html
psql:pg_gather/gather_report.sql:181: ERROR:  function max(pg_lsn) does not exist
LINE 1: ...TEST((SELECT(current_wal) FROM pg_gather),(SELECT MAX(sent_l...
                                                             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

lelutin avatar Apr 11 '23 22:04 lelutin

In order to check further options for this, I've added the upstream postgresql package source deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main and upgraded to postgresql 12.14-1.pgdg20.04+1 from that package archive, and I'm still getting the same error.

With the same package source installed, I've then purged postgresql-12 and installed postgresql-13 (13.10-1.pgdg20.04+1) instead and with that version of postgres report production works.

lelutin avatar Apr 11 '23 22:04 lelutin

Hi @fernandorb10 and @lelutin, Thank you for reporting this. Even though the data collection from PostgreSQL 10 onwards is supported, The analysis and report generation from the collected (which generally happens on the local machine (laptop) or a docker container) requires a more recent PostgreSQL version (13+) where max(pg_lsn) is implemented. The assumption was that the database person would have a recent version of PG on their own local machine. But, Please let me know if having an older PG version support for analysis and report generation is also essential.

jobinau avatar Apr 12 '23 04:04 jobinau

Hi @jobinau thanks for the contextualization of the error. On my part I don't require using version 12 locally for the report production so it's all good! I got the error though because I was reproducing the server setup.

Maybe simply adding a caveat in the README for the supported versions would help build users' expectation with regards to this?

lelutin avatar Apr 12 '23 12:04 lelutin

Thank you @lelutin for the valuable suggestion. The README is updated. https://github.com/jobinau/pg_gather/commit/eaf34c45b78958c630c0bdeb912c411095180609

jobinau avatar Apr 14 '23 12:04 jobinau