Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHNBM-0003MQ-Ix for pgsql-admin@arkaria.postgresql.org; Wed, 03 Mar 2021 08:48:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHNBL-0007hp-11 for pgsql-admin@arkaria.postgresql.org; Wed, 03 Mar 2021 08:48:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHNBK-0007hi-Pr for pgsql-admin@lists.postgresql.org; Wed, 03 Mar 2021 08:48:34 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lHNBI-0003AE-9R for pgsql-admin@lists.postgresql.org; Wed, 03 Mar 2021 08:48:34 +0000 Received: by mail-ed1-x52b.google.com with SMTP id b13so19651577edx.1 for ; Wed, 03 Mar 2021 00:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=NR/K3jHx9K13umsILIukkhM2KVgtMWI4HCTT3Mw8qS8=; b=Nf/B1Y5GDNXYGPLSMUKYaFfGIryeh0xiLvdEb2IDbStlL0oWs+GSR4ZF5j4NApXmY6 oOg4g6tQ5kyOhLg3JT8cs05z5s9u7gXqm7O2FB4P+n9pfhNr2B1uZqj+zuqQgeyEsqtI 99xhPvVQvpovdiNEpv/aRVltrcQDMcE1UBTIlBKpsZWNBW4mJGPkY7JJebYOE9eP19V1 7elEVtgIRpNeZtN9ooGAO9tBTCKrEpLJOXNZ2K0byEJO9G9Xc3AyukU772G17mnTeJkE XGZfBmvye3MKCYNKkBhWVMGgQ5hIRyPCj5XgGaqWkdn/b30FwB3if2BZz4WM38wLnDFN 9puA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=NR/K3jHx9K13umsILIukkhM2KVgtMWI4HCTT3Mw8qS8=; b=noKxBo+ubdsiM/GAKs2pF20y3/PuKdZIzhwVE2XCmzdVe9aT5X3dvljZPOLSyawO4S 49TYWozFqXZ1qPPgD4xwbCvHJZtDEFW2uZQJ8Fp0naMIACMXmuRoQdjszbiO5lV3HN0r huASw6gOHEHjhicpgt0++OC6pUQmVJ1LjBwZiK4+t+gCLaH6p5Lwj51W6fYh53kOKQtZ 8TGjdxDtuWNK5E90GzdC2Wax0QZBv96U4Ez4Gg5mS+LAoZYo8DWDj/M8MbbNC97rws8W dRoIDGfb0mJolwt1ml4+WZsO+tK+tJxwNXQlII6kkyGrZfPbfg7MqsybVN8s7Zcu5jYG JSYQ== X-Gm-Message-State: AOAM533eJLWISvmmeOFUXn/P2m62z8OaGuJmbIai+X8S0IWUwpCrFqu8 ygK/Z9VpA/goWvFIArLCcJ6l9A== X-Google-Smtp-Source: ABdhPJxGeQiEjZO33yThfRgjwfSxmpICwSoi8rW9h3WwAw3CxL8l3Hq/eZvufJOeXfC8tu/OsOrXsQ== X-Received: by 2002:a05:6402:158d:: with SMTP id c13mr24022270edv.297.1614761311313; Wed, 03 Mar 2021 00:48:31 -0800 (PST) Received: from localhost.localdomain (217-149-173-211.nat.highway.telekom.at. [217.149.173.211]) by smtp.gmail.com with ESMTPSA id u15sm7833884eds.6.2021.03.03.00.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 00:48:30 -0800 (PST) Message-ID: <7482c0a1ea0dba163e35160b4ee92ffb29052c2c.camel@cybertec.at> Subject: Re: Partition table Creation and Testing using Inherited method From: Laurenz Albe To: dbatoCloud Solution , pgsql-admin@lists.postgresql.org Date: Wed, 03 Mar 2021 09:48:30 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2021-03-03 at 08:49 +0530, dbatoCloud Solution wrote: > Someone guide me on partitioning, I used the declarative method( inheritance), > Created child tables, added check constraints and steps below which I mentioned it. > > step1 # > CREATE TABLE core.contact_transaction_history ( > > record_insert_datetime timestamp NULL, > crm_contact_type_id int4 NULL > ); > > step2# > CREATE TABLE core.contact_transaction_history_Year_2016() INHERITS (core.contact_transaction_history_PartMar2021); > CREATE TABLE core.contact_transaction_history_Year_2017() INHERITS (core.contact_transaction_history_PartMar2021); > CREATE TABLE core.contact_transaction_history_Year_2018() INHERITS (core.contact_transaction_history_PartMar2021); Don't use inheritance partitioning. Upgrade to a recent PostgreSQL release and use declarative partitioning. It is so much better when it comes to performance and maintenance costs. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com