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
pg_dump database -Fc backup.dump | |
pg_restore -l backup.dump | sed '/MATERIALIZED VIEW DATA/d' > restore.lst | |
pg_restore -L restore.lst -d database backup.dump | |
pg_restore -l backup.dump | grep 'MATERIALIZED VIEW DATA' > refresh.lst | |
pg_restore -L refresh.lst -d database backup.dump |
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
filename = 'c:\\Users\\ndufrane\qgis.log' | |
def write_log_message(message, tag, level): | |
with open(filename, 'a') as logfile: | |
logfile.write('{tag}({level}): {message}'.format(tag=tag, level=level, message=message)) | |
QgsApplication.messageLog().messageReceived.connect(write_log_message) |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |