Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCwTw-0005Lp-7k for pgsql-admin@arkaria.postgresql.org; Thu, 09 Nov 2017 23:43:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eCwTv-0007Wi-Qe for pgsql-admin@arkaria.postgresql.org; Thu, 09 Nov 2017 23:43:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eCwS4-0001p6-7O for pgsql-admin@postgresql.org; Thu, 09 Nov 2017 23:41:40 +0000 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eCwRw-00034M-Vw for pgsql-admin@postgresql.org; Thu, 09 Nov 2017 23:41:38 +0000 Received: by mail-qk0-x230.google.com with SMTP id x195so9897338qkb.12 for ; Thu, 09 Nov 2017 15:41:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WPoLxIXQva3T+VzHnsYxXGTt1l8ujlzE/vQ6lefz1ZI=; b=kV9okynDCFvZ6eaGCsj/eitL+1SOwW7lm0k2QwdcprTldzlPFPPX6VK/6x4pTBwmop T+bwkcafozqFmwfKjZPSHS0MCpfrg5LvTzbR0WtA+0jgpog6yazYIatYb7QaIvreqL+s rdziSyZUeueQjNoI10wcDxK4he+EsOMMPwkG5gE87Q3GneYS7lLrSyxu29hvYGdqkF8m PqE99Gsd3xq9BTqFIOUE1KgVd+zqgZpq4YD8jGvn7kNpysxeRoI+MHAxaET6dFeYd1t2 qxN0W/9VuJ2XCMHj0dVSqORlgYwQB4q0tB8KapdRrTXWQwfmdwXxy/qR8ITq3sKXSbH9 hvAg== 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=WPoLxIXQva3T+VzHnsYxXGTt1l8ujlzE/vQ6lefz1ZI=; b=KVb+yHiazf32GWNOZr2m+uepukD8+zmviRuaaGqeRa4YfhNBZADJG26/RMHZk35jPr 2i7h5qZPt08QUvU/6lFaswVQ4bw+pt3RblHsBMsKRNOlzgLxJYHVtY/ic03NWtRQhTcY U0efvs/FOf47iTbWLJo00/Z2N3gx9ntofRZJASR1Y2xPytLnj5U9x2ZliMaEnsqM07y8 m/9/338NwD/MzYC2c6UD2zjBsI5MRVNtV6M2BzpVw1AxoC1YNpU4HM8aC1rqsQeUwjMg ZwbgOXuJ7sovkTTfWlSF8KfiMR3i0L9jMkJMKUsBjAF2elnWUAQC8ZjAbzd15EeQIkJl 1OrA== X-Gm-Message-State: AJaThX7XgyvvwDxvil6YT/Jajgk8T2DHD0U5zqZvCZQgRXHc/rwCRAI+ JRi4ul3odRWI+HVfAaMzzZM= X-Google-Smtp-Source: AGs4zMbAHgmgYTTNWFDlT/Tznfg7dk/89ADovknCI9GAEC83KXQh9he0jMrIZ1KMdto/wejq67DbJg== X-Received: by 10.55.5.139 with SMTP id 133mr3468788qkf.220.1510270891904; Thu, 09 Nov 2017 15:41:31 -0800 (PST) Received: from [192.168.1.152] (pool-71-179-177-60.bltmmd.fios.verizon.net. [71.179.177.60]) by smtp.gmail.com with ESMTPSA id e43sm5567265qte.74.2017.11.09.15.41.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 15:41:31 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: Partitions From: John Scalia X-Mailer: iPad Mail (15A432) In-Reply-To: Date: Thu, 9 Nov 2017 18:41:25 -0500 Cc: pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: rammohan ganapavarapu 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 Set up a trigger on insert to check for the existence of the partition tabl= e, then it could do the insert there or create the table if needed and inse= rt. Look online. I know I=E2=80=99ve seen examples of this. =E2=80=94 Jay Sent from my iPad > 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 t= o 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 su= ggestions? >=20 > Thanks, > Ram --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin