Last active
August 29, 2015 14:02
-
-
Save bulkan/38ea6d546d83252121e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* To terminate connections of current users */ | |
SELECT pg_terminate_backend(pg_stat_activity.pid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = 'TARGET-db' | |
AND pid <> pg_backend_pid(); | |
/* update a timestamp field setting it 1 hour in the past from now */ | |
update mytable set "lastUpdated"=now() - interval '3 hour' ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment