Re: Convert Existing Table to a Partition Table in PG10 - Mailing list pgsql-general

From David Rowley
Subject Re: Convert Existing Table to a Partition Table in PG10
Date
Msg-id CAKJS1f_-zW2LMXrtd6h9O_Bb6YUVS5C2juP7awfd-YC9jR131A@mail.gmail.com
Whole thread Raw
In response to Re: Convert Existing Table to a Partition Table in PG10  (Clifford Snow <clifford@snowandsnow.us>)
Responses Re: Convert Existing Table to a Partition Table in PG10  (Clifford Snow <clifford@snowandsnow.us>)
List pgsql-general
On 1 July 2018 at 10:15, Clifford Snow <clifford@snowandsnow.us> wrote:
> I also leaned that my range partition value I used on a timestamp needed to
> have fractional seconds. I used a range of 2017-01-01 00:00:00 to
> 2017-23:59:59 which failed when I attempted to add a record that had a
> timestamp of 2017-23:59:59. Adding a fractional second to the range solved
> the problem.

Please be aware that with RANGE partitions the upper bound is
non-inclusive. The lower bound is inclusive.

If you want a 2017 partition, then FOR VALUES FROM ('2017-01-01') TO
('2018-01-01') will allow all 2017 timestamps and only 2017
timestamps.

You've no need to consider precision of the type and how many 9's you
add to anything here.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-general by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: Convert Existing Table to a Partition Table in PG10
Next
From: Clifford Snow
Date:
Subject: Re: Convert Existing Table to a Partition Table in PG10