Re: Partitioning by month causing an error?

Wells Oliver <[email protected]> Fri, 20 Dec 2019 18:32:02 -0800
Newsgroups gmane.comp.db.postgresql.admin
Message-ID <CAOC+FBXwJuW_rrjb=RzhoRcMfRYrx6GfyO9b53guQe1DVPZZPw@mail.gmail.com>
--0000000000009d43ba059a2d9b40
Content-Type: text/plain; charset="UTF-8"

mmd has a PARTITION BY RANGE on a date column.

On Fri, Dec 20, 2019 at 6:24 PM Ron <[email protected]> wrote:

> On 12/20/19 6:49 PM, Wells Oliver wrote:
> > I have a partition per each month, like this:
> >
> > CREATE TABLE mmd_yr2019_3 PARTITION OF mmd FOR VALUES FROM
> ('2019-03-01')
> > TO ('2019-03-31');
> > CREATE TABLE mmd_yr2019_4 PARTITION OF mmd FOR VALUES FROM
> ('2019-04-01')
> > TO ('2019-04-30');
> >
> > This breaks for dates at the end of the month. What's the better way to
> > write the bounds? 3/1 to 4/1 and then 4/1 to 5/1? Does that cause some
> > overlap issue?
>
> What is the mmd data type?  I ask that because '2019-03-31' is really
> '2019-03-31 00:00:00.000', so there's nowhere for '2019-03-31
> 00:00:00.001'
> through '2019-03-31 23:59:59.999' to go.  (And don't forget timezones.)
>
>
> --
> Angular momentum makes the world go 'round.
>
>
>

-- 
Wells Oliver
[email protected] <[email protected]>

--0000000000009d43ba059a2d9b40
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">mmd has a PARTITION BY RANGE on a date column.<br></div><b=
r><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, =
Dec 20, 2019 at 6:24 PM Ron &lt;<a href=3D"mailto:[email protected]">=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex">On 12/20/19 6:49 PM, Wells Oliver wrote:<br>
&gt; I have a partition per each month, like this:<br>
&gt;<br>
&gt; CREATE TABLE mmd_yr2019_3 PARTITION OF mmd FOR VALUES FROM (&#39;2019-=
03-01&#39;) <br>
&gt; TO (&#39;2019-03-31&#39;);<br>
&gt; CREATE TABLE mmd_yr2019_4 PARTITION OF mmd FOR VALUES FROM (&#39;2019-=
04-01&#39;) <br>
&gt; TO (&#39;2019-04-30&#39;);<br>
&gt;<br>
&gt; This breaks for dates at the end of the month. What&#39;s the better w=
ay to <br>
&gt; write the bounds? 3/1 to 4/1 and then 4/1 to 5/1? Does that cause some=
 <br>
&gt; overlap issue?<br>
<br>
What is the mmd data type?=C2=A0 I ask that because &#39;2019-03-31&#39; is=
 really <br>
&#39;2019-03-31 00:00:00.000&#39;, so there&#39;s nowhere for &#39;2019-03-=
31 00:00:00.001&#39; <br>
through &#39;2019-03-31 23:59:59.999&#39; to go.=C2=A0 (And don&#39;t forge=
t timezones.)<br>
<br>
<br>
-- <br>
Angular momentum makes the world go &#39;round.<br>
<br>
<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature"><div dir=3D"ltr"><div>Wells Oliver<br><a href=3D"mailto:wel=
[email protected]" target=3D"_blank">[email protected]</a></div></div=
></div>

--0000000000009d43ba059a2d9b40--