Skip to content

Instantly share code, notes, and snippets.

View gled-rs's full-sized avatar

Tristan Mahé gled-rs

View GitHub Profile
USER=plume
DBUSER=plume
DBPASS=changeme
DBHOST=127.0.0.1
DBPORT=5432
DBNAME=plume
DBURL=postgres://$DBUSER:$DBPASS@$DBHOST:$DBPORT/$DBNAME
# on the db server:
createuser -d -P $USER
Apr 17 21:57:51 mastodon celery[5420]: [2018-04-17 21:57:51,815: ERROR/ForkPoolWorker-6] Task federation.scan_library_page[85d971ba-ea6a-4ab3-92e4-cecf55bf4384] raised unexpected: AttributeError("'NoneType' obje
Apr 17 21:57:51 mastodon celery[5420]: Traceback (most recent call last):
Apr 17 21:57:51 mastodon celery[5420]: File "/srv/funkwhale/virtualenv/lib/python3.5/site-packages/celery/app/trace.py", line 374, in trace_task
Apr 17 21:57:51 mastodon celery[5420]: R = retval = fun(*args, **kwargs)
Apr 17 21:57:51 mastodon celery[5420]: File "/srv/funkwhale/virtualenv/lib/python3.5/site-packages/celery/app/trace.py", line 629, in __protected_call__
Apr 17 21:57:51 mastodon celery[5420]: return self.run(*args, **kwargs)
Apr 17 21:57:51 mastodon celery[5420]: File "/srv/funkwhale/virtualenv/lib/python3.5/site-packages/celery/app/base.py", line 472, in run
Apr 17 21:57:51 mastodon celery[5420]: return task._orig_run(*args, **kwargs)
Apr 17 21:57:51 mastodon celery[5420]: File "/srv/funkwhale/
@gled-rs
gled-rs / gist:533b2a659d8d1b9245947b992039ab09
Created March 14, 2018 16:42
Postgresql List dead tuples, number of rows, last vaccum and last analyze
WITH rel_set AS
(
SELECT
oid,
CASE split_part(split_part(array_to_string(reloptions, ','), 'autovacuum_vacuum_threshold=', 2), ',', 1)
WHEN '' THEN NULL
ELSE split_part(split_part(array_to_string(reloptions, ','), 'autovacuum_vacuum_threshold=', 2), ',', 1)::BIGINT
END AS rel_av_vac_threshold,
CASE split_part(split_part(array_to_string(reloptions, ','), 'autovacuum_analyze_threshold=', 2), ',', 1)
WHEN '' THEN NULL