powa-team / powa

PostgreSQL Workload Analyzer
http://powa.readthedocs.io/
PostgreSQL License
778 stars 57 forks source link

function "pg_track_settings_snapshot_settings" failed #120

Closed Ikrar-k closed 5 years ago

Ikrar-k commented 5 years ago

I am getting the below error for remote server.

powa_take_snapshot(1): function "pg_track_settings_snapshot_settings" failed: null value in column "ts" violates not-null constraint

rjuju commented 5 years ago

Hello,

I think you already reported this problem. It was fixed in https://github.com/rjuju/pg_track_settings/commit/bc0c061739c10100c7a1f3acb8f872a2a3e9b0db, though I didn't release v2.0.0 yet. I can go ahead and tag the release now, especially if you can confirm that the commit does solve your problem?

Ikrar-k commented 5 years ago

I forgot to recreate the extension. This can be closed. Thanks a lot for helping.

Ikrar-k commented 5 years ago

It was working and I started the seeing issue again.

powa=# select powa_take_snapshot(1); powa_take_snapshot

              0

(1 row)

powa=# select powa_take_snapshot(1); WARNING: powa_take_snapshot(1): function "pg_track_settings_snapshot_settings" failed: state : 23502 message: null value in column "ts" violates not-null constraint detail : Failing row contains (1, null, allow_system_table_mods, null, t, null). hint : context: SQL statement "WITH src AS ( SELECT * FROM public.pg_track_settings_settings_src(_srvid) ), dropped AS ( SELECT s.ts, l.srvid, l.name FROM public.pg_track_settings_list l LEFT JOIN src s ON s.name = l.name WHERE l.srvid = _srvid AND s.name IS NULL ), mark_dropped AS ( INSERT INTO public.pg_track_settings_history (srvid, ts, name, setting, setting_pretty, is_dropped) SELECT srvid, ts, name, NULL, NULL, true FROM dropped ) DELETE FROM public.pg_track_settings_list l USING dropped d WHERE d.name = l.name AND d.srvid = l.srvid AND l.srvid = _srvid" PL/pgSQL function pg_track_settings_snapshot_settings(integer) line 16 at SQL statement SQL statement "SELECT pg_track_settings_snapshot_settings(1)" PL/pgSQL function powa_take_snapshot(integer) line 63 at EXECUTE powa_take_snapshot

              1

(1 row)

powa=#

rjuju commented 5 years ago

Did you recreate the extension on the repository server too?

Ikrar-k commented 5 years ago

Yes, I did. But the issue is persistent.

rjuju commented 5 years ago

Ah I see, I indeed made an embarassing mistake when fixing the original problem.

I just pushed a commit (https://github.com/rjuju/pg_track_settings/commit/4cea1136da3047902e587e2b3c3b5fe39f0be602) that should fix (again) this issue! Let me know if that's now ok.

Ikrar-k commented 5 years ago

Yes, Not seeing any issue now. This can be closed.

rjuju commented 5 years ago

Great, thanks for testing and feedback!