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 1p0MCv-0003fd-OK for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Nov 2022 12:28:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p0MCu-00011B-0z for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Nov 2022 12:28:56 +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 1p0MCt-000111-Kh for pgsql-hackers@lists.postgresql.org; Wed, 30 Nov 2022 12:28:55 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p0MCq-0007nF-QK for pgsql-hackers@lists.postgresql.org; Wed, 30 Nov 2022 12:28:55 +0000 Received: by mail-ej1-x635.google.com with SMTP id n20so41016638ejh.0 for ; Wed, 30 Nov 2022 04:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=VXAbJ8s4qxlOCJOXHhWnIncE/FJ1fMPWCfJCHLRJzhU=; b=RG+iFktpQXIWMez7mSykDvjmYHpswb6X96B+aHaPKKBTZ3XlMzWrBS8bSP0Yt3kuXS PedO0I1GuAynDJdKAfYVfrUHWI8dK3irsQLinJsaupAQDpOrSVif4uiPjWY+b/tQ65As 2us1iE5H8zkmv4AEiF99q5ld5sOmmQDvlyh7cPAJGurZSjw1jGSJOvbqNCZzpGl+gZXq /+/fzyjkQrf3M5CMZAU7SUurCaOYURba+wc9Rzzvrk2G2TQMMCemlUHOXFPXb58EaANu AhxjmWY07R09o5T7jafWQ3NYFiDVlv4IpEdz7QdjY8QMrlPFzMMu5OLICqBa3MzB9KvS m+8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VXAbJ8s4qxlOCJOXHhWnIncE/FJ1fMPWCfJCHLRJzhU=; b=47ySdKdDfsDCrhyP+ALXWN6UUAtF9ljDRZtO0Yh7qkA7cAbRYkygjoJzOwPYFibRoF +sx2JHPHB0PswgxNmYXgwfcIey74pXfHDpa0MvmpyRt3j19MwcXiBu10vILIFeC+n2i2 EeeBE6xdiSh9/x7SsVWwbzzohwv0xepa8ThsB4mpsV1pOU1JJB+0lipBmTh91SOk3nqQ WD1EvfKDfNggAhCZ71DCJyTarX9XolsiliL7xZxAuMBA1iSmKnlSiyfOGuITeQ7Jq2Xh mfWhawykW5i3YKOW8GiKWV3PYXjBConT+fzUZLAo8D49eLbQ+F3Xj3F69jIoyb0xkxEH jfjA== X-Gm-Message-State: ANoB5plWwKA0as6IVuPg/94Crmz/7EYn5KCNXIrO//na0TPXJEpcqkxN /lDyK+gMV+EA1Ki0fbI03wrWhw== X-Google-Smtp-Source: AA0mqf72twzdcCBPSDPJgR1X73oUr1EtfkpqM4tspHcNUhtYFSjH0DMQv0rS56wHTpbuEpseu5Z1TQ== X-Received: by 2002:a17:906:8a4d:b0:7b5:73aa:9988 with SMTP id gx13-20020a1709068a4d00b007b573aa9988mr41824621ejc.597.1669811331584; Wed, 30 Nov 2022 04:28:51 -0800 (PST) Received: from localhost.localdomain ([2001:871:5e:b47b:e706:88d7:ceb1:a099]) by smtp.gmail.com with ESMTPSA id ky23-20020a170907779700b0077909095acasm586723ejc.143.2022.11.30.04.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 04:28:50 -0800 (PST) Message-ID: <0086c87f900172e4103a4563e7ffc05856e21412.camel@cybertec.at> Subject: Re: Patch: Global Unique Index From: Laurenz Albe To: Vik Fearing , Cary Huang , Thomas Kellerer Cc: pgsql-hackers Date: Wed, 30 Nov 2022 13:28:50 +0100 In-Reply-To: <922afef1-430c-e929-2589-ec3190bb11d7@postgresfriends.org> References: <184879c5306.12490ea581628934.7312528450011769010@highgo.ca> <3866851668762233@ja6lqgzbqb6tniny.sas.yp-c.yandex.net> <2187643.1668783992@sss.pgh.pa.us> <6cdcb7b1-2567-1373-79d1-96467a9b305b@gmx.net> <184aada3c76.1258dc67d3231678.3658037825540104775@highgo.ca> <26fcfb7700783faa397c712ea9721090958e0e51.camel@cybertec.at> <922afef1-430c-e929-2589-ec3190bb11d7@postgresfriends.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2022-11-30 at 10:09 +0100, Vik Fearing wrote: > On 11/29/22 17:29, Laurenz Albe wrote: > > On Tue, 2022-11-29 at 13:58 +0100, Vik Fearing wrote: > > > I disagree.  A user does not need to know that a table is partitionned, > > > and if the user wants a unique constraint on the table then making them > > > type an extra word to get it is just annoying. > > > > Hmm.  But if I created a primary key without thinking too hard about it, > > only to discover later that dropping old partitions has become a problem, > > I would not be too happy either. > > I have not looked at this patch, but my understanding of its design is > the "global" part of the index just makes sure to check a unique index > on each partition.  I don't see from that how dropping old partitions > would be a problem. Right, I should have looked closer. But, according to the parallel discussion, ATTACH PARTITION might be a problem. A global index is likely to be a footgun one way or the other, so I think it should at least have a safety on (CREATE PARTITIONED GLOBAL INDEX or something). Yours, Laurenz Albe