Skip to content

Instantly share code, notes, and snippets.

@Tusenka
Last active October 15, 2024 15:03
Show Gist options
  • Save Tusenka/fcd23be9b66c32b1975715f4ff327ddf to your computer and use it in GitHub Desktop.
Save Tusenka/fcd23be9b66c32b1975715f4ff327ddf to your computer and use it in GitHub Desktop.
CREATE TABLE post_partitioned (
pk int GENERATED ALWAYS AS IDENTITY,
title TEXT,
content TEXT,
author INTEGER,
category INTEGER,
reply_to INTEGER,
created_on TIMESTAMP WITH TIME ZONE,
last_edited_on TIMESTAMP WITH TIME ZONE,
editable BOOLEAN,
likes INTEGER,
CONSTRAINT created UNIQUE ( pk, created_on )
)
PARTITION BY RANGE (created_on);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment