Skip to content

Instantly share code, notes, and snippets.

@vitormil
Created May 20, 2021 14:20
Show Gist options
  • Save vitormil/4ed26b0112a5dde52861bb6b84330637 to your computer and use it in GitHub Desktop.
Save vitormil/4ed26b0112a5dde52861bb6b84330637 to your computer and use it in GitHub Desktop.
create table test (id int, a timestamp) partition by list ( (trunc(extract(second from a))::int % 3));
create table test01 partition of test for values in (0);
create table test02 partition of test for values in (1);
create table test03 partition of test for values in (2);
insert into test values (555, now());
select *
from test
where id = 555;
select 0, * from test01
union all
select 1, * from test02
union all
select 2, * from test03;
truncate table test01;
drop table test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment