From 9344d7eaf4eb059c5d7359568eaed438c5e322e2 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 26 Jan 2021 15:27:31 +0100 Subject: [PATCH] Add a couple of information/commands on the migration.sql Signed-off-by: Pierre-Yves Chibon --- scripts/migration.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/migration.sql b/scripts/migration.sql index ac89117..9b89cf3 100644 --- a/scripts/migration.sql +++ b/scripts/migration.sql @@ -1,3 +1,5 @@ +\timing on + -- Update the current messages table so it stores the year that we'll partition -- on. @@ -5,6 +7,8 @@ ALTER TABLE messages ADD COLUMN year integer; update messages set year = extract(year from timestamp); +-- Schema extracted using: +-- sudo -u postgres pg_dump -t 'public.messages' --schema-only datanommer -- Create the messages2 table that will be partitioned and will have the messages -- moved to