The following set of scripts will create daily backups for a specified database (8:45 am / when a computer reboots).
# Copy files to their respective folders then execute the following:
chmod u+x ~/scripts/auto_postgres_backup.sh
DELETE FROM cspecificationvalues | |
WHERE id IN( | |
SELECT | |
id FROM ( | |
SELECT | |
id, ROW_NUMBER() OVER (PARTITION BY cspecification_id, cengine_id ORDER BY id) AS row_num FROM cspecificationvalues) t | |
WHERE | |
t.row_num > 1); |
# https://stackoverflow.com/questions/8910494/how-to-update-selected-rows-with-values-from-a-csv-file-in-postgres | |
CREATE TEMP TABLE tmp_x AS | |
SELECT | |
* | |
FROM | |
cmakes | |
LIMIT 0; | |
COPY tmp_x |