Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCyhJ-0005Lg-5Z for pgsql-admin@arkaria.postgresql.org; Fri, 10 Nov 2017 02:05:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eCyhI-0001PN-Oa for pgsql-admin@arkaria.postgresql.org; Fri, 10 Nov 2017 02:05:32 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eCyfS-0003nm-BD for pgsql-admin@postgresql.org; Fri, 10 Nov 2017 02:03:38 +0000 Received: from mail-it0-x233.google.com ([2607:f8b0:4001:c0b::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eCyfO-0000G1-T1 for pgsql-admin@postgresql.org; Fri, 10 Nov 2017 02:03:37 +0000 Received: by mail-it0-x233.google.com with SMTP id l196so13087003itl.4 for ; Thu, 09 Nov 2017 18:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openscg-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UzeWOUfvMlZx4/Dqt49UfH7/WwAYwfcexba9nHHAwL4=; b=HBpEz75OGdzcYH412AYgGxF1eoMcvIgKh12dsTRcz6XxJSE32uh4a9sUjsiORKn2xJ OKNR4f2TX5uQXvKl/iVvwVBbWP0ttwez7g1+NHv9SNanlF2XPYXkGq7WD3/9JDVYowsc UmiuWDlqxHtz26jSBEXD3608+UGP+mWfMyk4fyMgMUpFi3L//5IRqFIZtdLSeSguW70n XlRp9sp8LZdGB9sRHDK5VYI2O78LWIU+ITCYK2z7pRNIMzg26+Yl0h2hByvXFHY1HXDt pbL9K8w7VBZK2ARxEiPXR2kZehgbblAiLnmLhZIOufQ9WAdXr9DVDHRmDerHGGYdtGXK d/cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UzeWOUfvMlZx4/Dqt49UfH7/WwAYwfcexba9nHHAwL4=; b=Bh4IdIZmWWZ4Eet1PQicwPSyz9B4IV1uCL4AKHnuWkYhmiPy5F2aRta/tP/mNsps1T srxR9DtIqnLsOsV+S522xYLpjsk3QYGgSp1Qa3Czw2YirCweolObdE7S2mruh0W/bSVe 1EWivsJtnWWNR95MgMk9EdFKbBA1Kqi8XPB5vdnBdEfcvn76Llx5ZLhcSPcinswmhtfW n4OtOIz7kIC8/n7gDWfn4NMOrYzDQXJbLDZm4egCkMapYVOg++WFcfck5HFhxLEgynkz NAEgnj2NeqvI992ubgaV11Ig1L9pH8uQ5sfnxQNrJrfVBTWiOuCu1ktcTbhM/3jZay8J DL+Q== X-Gm-Message-State: AJaThX6vm/zreAG2APVzLklQjEw9giBg6rm8buBFXUjqBjKXPhsLAgPe y0/4YrivZgvB+7WVA82HURtC4g== X-Google-Smtp-Source: ABhQp+SXTXzLhdxo7ygVKfkUWIPoYdQFxXv8mKr39JRjppnS+EbPeeOYGTkhECZWzXYiAMG37hzh5w== X-Received: by 10.36.37.18 with SMTP id g18mr2325486itg.86.1510279412803; Thu, 09 Nov 2017 18:03:32 -0800 (PST) Received: from [192.168.115.100] (cpe-66-66-220-41.rochester.res.rr.com. [66.66.220.41]) by smtp.gmail.com with ESMTPSA id g195sm215924itc.14.2017.11.09.18.03.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 18:03:31 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: Partitions From: Scott Mead X-Mailer: iPhone Mail (15B93) In-Reply-To: Date: Thu, 9 Nov 2017 21:03:30 -0500 Cc: rammohan ganapavarapu , pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <4B91E005-F3DB-499A-A20C-C68AEDF3320D@openscg.com> References: To: John Scalia List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org > On Nov 9, 2017, at 18:41, John Scalia wrote: >=20 > Set up a trigger on insert to check for the existence of the partition ta= ble, then it could do the insert there or create the table if needed and in= sert. Look online. I know I=E2=80=99ve seen examples of this. Be careful here, these solutions generally take a massive performance hit. = The best method is the native pg_partman function. It includes a built-in s= cheduler so that you don=E2=80=99t need to rely on an external tool like cr= on.=20 > =E2=80=94 > Jay >=20 > Sent from my iPad >=20 >> On Nov 9, 2017, at 6:28 PM, rammohan ganapavarapu wrote: >>=20 >> Hi, >>=20 >> I have a requirement to create monthly partitions in my db, i am trying = to understand what is the best way to do it, i know i can run a cron job to= check if partition exist and create if not at the starting of month. Any s= uggestions? >>=20 >> Thanks, >> Ram >=20 >=20 > --=20 > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin