Skip to content

Postgres Cheat Sheet

Brian Jubelirer edited this page Mar 13, 2023 · 1 revision

Delete permits from recent sources

BEGIN TRANSACTION;
DELETE from smart.permits where source_id > 263;
DELETE from smart_private.users_sources where source_id > 263;
DELETE from smart.sources where id > 263;
COMMIT;

Rerun moviegen on a permit

moviegen will run if moviegen is true AND moviegen_retry < 3. moviegen defaults to true for all new ingests, and is set to false only when movie generation succeeds (guaranteed to have image_url set). As a result, the following will usually suffice.

UPDATE smart.permits SET moviegen_retry=0 where <condition>

the moviegen service sleeps when no new movies are needed. It will take a few seconds for it to recheck once running the query.

Creating a new account

SELECT smart_private.register_user('my_username', 'my_password');
INSERT INTO users_sources('user_id','source_id') VALUES(999,999);

Clone this wiki locally