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 1pKzDx-0003dt-3z for pgsql-admin@arkaria.postgresql.org; Thu, 26 Jan 2023 10:11:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKzDw-0003Fn-0n for pgsql-admin@arkaria.postgresql.org; Thu, 26 Jan 2023 10:11:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKzDv-0003Fd-KB for pgsql-admin@lists.postgresql.org; Thu, 26 Jan 2023 10:11:15 +0000 Received: from mail.unimaticaspa.it ([89.97.230.136]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKzDs-0004h9-NH for pgsql-admin@lists.postgresql.org; Thu, 26 Jan 2023 10:11:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=unimaticaspa.it; s=mail; h=Message-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:Subject:From:References:To:MIME-Version:Date:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/x4wxSsTD+82aPpb/8LID8uzho71wDTgQIuUjlUgoEw=; t=1674727872; x=1676023872; b=qfmxPfuy76Ldsxl3bbkJigBHQJrbQ0VsH9+tdvY4zK3BXZx7BBPFd2WFWQNIFOcuBb0PInLzpgJ kPKGxl/hmFTHHLz1Zb7BgOJOvWRyM5R8AU7l8bZRsIvsHlK+jUMdVbAjUmJ29uKQOrAycR7Wu+h53 V4PVt6RHsSp3CxZhxshqQdnD12hWIGlxgoCl7lYh6EW6gqz0mf1T2NE0vgG7dGBWg4l/L1Hcx7FYm wNy4oax0E+p0wl1Qq4Yo1jt5qw3Sar60QS5E2UgYWDsLcckc5Ih2zynKH5XAFOkYkQfrvmdV5XWNO ZcIEm9wcuoG89E43sWdgkTSvGACo2qHLJb1f7+FENXkcny7S9bXGV5Qk8wGZx5c2BwKVVQdDHD+Nk SEb4HaYL2ACcdhYFyz8CuEQ69pr+qI3M+mL50pnNscf5pKk9PmXh5G+buWGimu3gPQE6bdOv36zCO qQnx1+5AaDYidKvZchCUI5XYfJcM2Z7uVA68l6z1NPmm/KF2uKef+OJsMm/DZaHUNQUKdnwRAqAh+ KHejYDBoCepadkyJasphFzbjp04M4r6JmFaTIumONyYuxKaxAbq3Eo8c2pEStBql18FHgJlZfc6OO Q18NM3sO/tpswdDokVnHug1uvU0kNHyp7JFb3z5Y29Eg3Z/gQhktuqZwKmBFd0mjoe970=; Received: from pc-ortensi-fisso.unimatica.lan ([10.143.90.127]) by mail.unimaticaspa.it with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pKzDp-00CgfG-JH for pgsql-admin@lists.postgresql.org; Thu, 26 Jan 2023 11:11:09 +0100 Date: Thu, 26 Jan 2023 11:11:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: pgsql-admin@lists.postgresql.org References: From: Massimo Ortensi Subject: Problems with unique constraints In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Unimatica-LocalUser: true Message-Id: <1pKzDp-00CgfG-JH@unimaticaspa.it> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I had troubles with some unique constraints recently. They simply didn't work, not seeing some records (select found only 47 records with specific values instead of 65, insert could create duplicate records). The constraint were on multiple columns. Drop constraint and create constraint fixed the problem. This happened on two servers : - a version 10 server,  where an abnormal poweroff happened 6 months ago, found 3 tables with the problem throughout last 6 months. - a test server, found the problem on 1 table after upgrading version 10 to 14 Anythng similar happened to anybody ? How can I find out if similar problems are present ? constraint and index looked ok and were used