Skip to content

Instantly share code, notes, and snippets.

@sahapasci
sahapasci / create-partitioned-table.sql
Created May 20, 2020 15:20 — forked from edib/create-partitioned-table.sql
Migrate non-partioned table to a partitioned table.
-- base table
-- drop table users cascade;
CREATE TABLE users (
id serial PRIMARY KEY,
username text NOT NULL UNIQUE,
password text,
created_on timestamptz NOT NULL,
last_logged_on timestamptz NOT NULL