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 1oaZpj-0001RE-MT for pgsql-sql@arkaria.postgresql.org; Tue, 20 Sep 2022 09:46:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oaZpi-0001UG-KG for pgsql-sql@arkaria.postgresql.org; Tue, 20 Sep 2022 09:46:26 +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 1oaZpi-0001U7-9W for pgsql-sql@lists.postgresql.org; Tue, 20 Sep 2022 09:46:26 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oaZpe-0007cx-18 for pgsql-sql@lists.postgresql.org; Tue, 20 Sep 2022 09:46:25 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-11e9a7135easo3381769fac.6 for ; Tue, 20 Sep 2022 02:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=PswR49eqZV8ByfHWuZTTGTdQPFyg79Rp1y9bngTcxgE=; b=jFVL/LiG54XJxqJQmDGdNaFMn0VwSb44Ro1AEpjE8VG5whXpvUFe/oyZiKYrlosEq8 ph52ufwGK/0kJJZ0m9+uzF5bilbI0TvUjWjj+RybuQChjfkPOWRo7Bd4X9Gy16JPU3PX n07iTdExi/wrcaTMeAhERFjaMq93UWAYyUZSS9egxS4SJJYNVD0gwtyn7Y0LyZXwf/jc 79u3vln2BG/MBitLL04E4PM6deSgk96Bfv6CEPxNlLJAXsmmgfLfG6b3MEaJzg2PUSEd /1LgnoH/LQDrFFasXlGVBAtilfyN5G4Jjrv4s+oWrc3RO5cWgPZqWqoWfILQRqlBvm0Z gNUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=PswR49eqZV8ByfHWuZTTGTdQPFyg79Rp1y9bngTcxgE=; b=xKrMMpQEs9KH+YzUITpxPN53mF7lkc5RF1pChHu3QUHbrKOtgctv+BsbYKiSZ9Dkow CFEvEbeZTEgwjYS60VDLvqoScqmumArMYp1N0dMgjz3FKQRZR763e+xj1KNMbbIJrBhL spiAwIJq7WtYjE44e8Rf3Lr/FbSDbZAPpelmxqZJDKRlLN6KAsk+BDS2caiS0U3vJRTN n3woKagQ1kjNcnrSHGcYbCIHo46ZHGf6Q0e49tOOJnAkzIVL3iBhbtXlZ1UStYFW+UXm 0jdBPE/MID5LpjymETkKcBIBySOlLIL/uR+UWB4JWNhnyI8WOd4tKkMgxEKAA3+14LG6 JSYQ== X-Gm-Message-State: ACrzQf0VhQN+lh+e2QVVV6y7n+lyqdPTf2+M9G9KkXmLnnVMqEttHCXO GDnyPAVs1dT3PTULBQVTFkXZirAsSgmL5F0NwgA= X-Google-Smtp-Source: AMsMyM6PDBmAy6EdJXgwNX3ItVaIWzcVcSifyDv+wnQdVzszJtH2Lb5QStasgv2U0J4IjExBfE+xSndk2NLQRmgwmKY= X-Received: by 2002:a05:6870:a411:b0:122:84e4:ad75 with SMTP id m17-20020a056870a41100b0012284e4ad75mr1417899oal.259.1663667179847; Tue, 20 Sep 2022 02:46:19 -0700 (PDT) MIME-Version: 1.0 References: <3585170.1663310489@sss.pgh.pa.us> In-Reply-To: From: David Rowley Date: Tue, 20 Sep 2022 21:46:07 +1200 Message-ID: Subject: Re: ON CONFLICT clause NOT working on Partition Table PostgreSQL 12 To: Inzamam Shafiq Cc: Tom Lane , Steve Midgley , "pgsql-sql@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 16 Sept 2022 at 19:52, Inzamam Shafiq wrote: > Is there anyway we can create constraint on column only which are not part of partition key? Unfortunately, there is no way to create a unique or primary key constraint unless the constraint contains all columns from the partition key. This is explained in the limitations section in [1]. If you need such a constraint, then you might want to consider changing your partition key. David [1] https://www.postgresql.org/docs/12/ddl-partitioning.html