Re: Convert Existing Table to a Partition Table in PG10

From: Clifford Snow <clifford(at)snowandsnow(dot)us>
To: david(dot)rowley(at)2ndquadrant(dot)com
Cc: srkrishna(at)yahoo(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Convert Existing Table to a Partition Table in PG10
Date: 2018-07-01 23:43:44
Message-ID: CADAoPLowhpMKfOniMy2Sg3ei=G=NZXt80K4UTsj3EvjD6+_mUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David,
Thanks for the suggestion. That really simplifies creating the RANGE.

For all, I'm pretty much a postgresql novice, but I've tried to document
what I've learned in the hopes that it can help someone else.

You can read my blog post at
https://osm_seattle.snowandsnow.us/articles/Partitioning-Postgresql/

Clifford

On Sun, Jul 1, 2018 at 2:23 PM David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
wrote:

> On 1 July 2018 at 10:15, Clifford Snow <clifford(at)snowandsnow(dot)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
>

--
@osm_seattle
osm_seattle.snowandsnow.us
OpenStreetMap: Maps with a human touch

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vik Fearing 2018-07-02 00:13:42 Re: Convert Existing Table to a Partition Table in PG10
Previous Message David Rowley 2018-07-01 21:23:47 Re: Convert Existing Table to a Partition Table in PG10