Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiURo-0006Vq-Mf for pgsql-admin@arkaria.postgresql.org; Sat, 21 Dec 2019 02:24:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiURn-0001uL-Bn for pgsql-admin@arkaria.postgresql.org; Sat, 21 Dec 2019 02:24:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiURm-0001uE-VM for pgsql-admin@lists.postgresql.org; Sat, 21 Dec 2019 02:24:51 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iiURk-00071H-QK for pgsql-admin@lists.postgresql.org; Sat, 21 Dec 2019 02:24:50 +0000 Received: by mail-ot1-x329.google.com with SMTP id a15so14302727otf.1 for ; Fri, 20 Dec 2019 18:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=JexTl2O59+52fSf8SJ9tWVUu3dpBO2fKnANM1qUx6os=; b=h1+u4Df8Yh+QMmnsrriJnkzdTpc6ug3N0lr143j5kb1vYDPspy7duzNs/4a1HlhE0M cgXHVDE+Gjja7ZykdYb1TUh5t+obD943g2y4tHI0wgP81x6TXFkhjZfBjxWfCDUBsttg LC0DhwL3REWVpyVfIK/IewRLYLw5RVuRXAmXWEaNk7zp86Mu4HbJd+NFg+PmwvY0ZFwj DY/LB3XY3C4Lr1EVPM0ZnGOlMvRw2I3PRy8PWeXCsHABvhriyyWCFU3A6evRcNPnrCKV k8vgYXgmV7F4WQXA04OvWknTeHVjbmmMxde7F80LD2FxeDzoUEeZ1DSxCVEakwRwGjj0 JBiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JexTl2O59+52fSf8SJ9tWVUu3dpBO2fKnANM1qUx6os=; b=Fk0Tj6A2196TF8gUF2XZGccXbtkRXVeHJsLpcak7FTDTTq+8WiHC0FIKWmbiRAM3tx Xn78rcg9Kw2wcfqNgQjk513ke6hzvN+TSM9n2nUVIEF5HoKnlyPJQ5vI1ktbQrqFopS5 BiEwt2cLIYmxKSbuf5nN94LD0Ttl5vVN9Z7ZSPQPAqRXzrl/2OJlj6QCDK1y/FS0gs8X Pa7JL8RHW4Ax7jHNbTq0gV66O03NybPxgLolk8Dng+q840Sz9jnT8x7WRHMimLfi4gZe CE7apuYygJu+ZOffX7GIRRTiM3VJABdB4ForekssOAmXhYcBz616DjfMfNkpv9lzHZd3 JQXg== X-Gm-Message-State: APjAAAXAA27EfMEmstIaBxS1hq5NbxpST4PHjhqlUYK7jC6ArnZA7mY5 Fh/xPKlHBFStXeu7uhXRVdF+dDZFfGw= X-Google-Smtp-Source: APXvYqw1d5zoZVzt83J+hveL7ZolZNl+fmETU+zRvhq2UE0ESyjsbCqawQEApxPGnd3lM+fqR1MdLA== X-Received: by 2002:a05:6830:1251:: with SMTP id s17mr18185732otp.108.1576895085851; Fri, 20 Dec 2019 18:24:45 -0800 (PST) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id c10sm4100915otl.77.2019.12.20.18.24.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Dec 2019 18:24:45 -0800 (PST) Subject: Re: Partitioning by month causing an error? To: pgsql-admin@lists.postgresql.org References: From: Ron Message-ID: Date: Fri, 20 Dec 2019 20:24:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.