Create data table and partition it by state
CREATE TABLE data (
id bigserial not null,
state smallint not null DEFAULT 1,
updated_at timestamp without time zone default now()
) partition by list(state);
create table data_pending partition of data for values in (1);
create table data_processing partition of data for values in (2);