Postgresql 10 range partition - Mailing list pgsql-novice

From Garry Chen
Subject Postgresql 10 range partition
Date
Msg-id A004F027-702E-42F9-A725-D4044CD8DA5F@cornell.edu
Whole thread Raw
Responses Re: Postgresql 10 range partition
List pgsql-novice

HI All,

                I would like to create a range partition table but my question is when create the partitions can I use for values less then?  If LESS THEN is not passable what is my options?  Here is what I try to do.

 

CREATE TABLE measurement (

    city_id                     int not null,

    MONTH_SID         integer not null,

    peaktemp              int,

    unitsales                 int

) PARTITION BY RANGE (MONTH_SID);

CREATE TABLE measurement_y2010 PARTITION OF measurement

    FOR VALUES LESS THEN (201007)

NOTE: Any month_SID values less than 2010 July

CREATE TABLE measurement_y2011 PARTITION OF measurement

    FOR VALUES LESS THEN (201107)

NOTE: Any month_SID values between 2010 July  and 2011 June

….

Skip here

….

CREATE TABLE measurement_y2017 PARTITION OF measurement

    FOR VALUES LESS THEN (201707)

NOTE: Any month_SID values between 2016 July  and 2017 June

CREATE TABLE measurement_y2018 PARTITION OF measurement

    FOR VALUES LESS THEN (201807)

NOTE: Any month_SID values between 2017 July  and 2018 June

 

Thank you very much for your input,

Garry

 

pgsql-novice by date:

Previous
From: john snow
Date:
Subject: Re: additional question about postgresql 10 's new identity column
Next
From: "David G. Johnston"
Date:
Subject: Re: Postgresql 10 range partition