Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwGnL-00AkLE-EA for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2023 06:58:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qwGnJ-00CDHn-RK for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2023 06:58:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwGnJ-00CDHG-Hw for pgsql-hackers@lists.postgresql.org; Fri, 27 Oct 2023 06:58:09 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qwGnF-0033ae-3Y for pgsql-hackers@lists.postgresql.org; Fri, 27 Oct 2023 06:58:08 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9c75ceea588so261266466b.3 for ; Thu, 26 Oct 2023 23:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1698389883; x=1698994683; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=cfg7qgpdhJ5WxvZhox4hPIQXV+oR0FgkTClxqj+G19g=; b=v1OcCIYoqBbDCOzyM9GGpDt76PVPDeWsBjsjKgTrEJENauSHXG+vQSVdC+tlbUDGLg IbGLAogVGg+Yu0d/WRq91ASnqN3hF0rTsqdldhOFd1LLZhj4+8v58GLW9guLI2aunXBn kB4ERcROVPIldx6cLgz7MiffUUfnMIGPLnJgoeQpI5zeMTccSlBB9R6hldnbQ4BSiV9c nU8dN1wgzi+Wc52TKHepIPsT/51E1WUSKzZA/gzvmEaCBXqDEVh4whGjH0JoAbWIROPk rdF13xJGQOcNUc086IH3RbxnDeNSerN4PlE+sJxVofUx4roglI/15MtuP8fM/DuMHhWq lGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698389883; x=1698994683; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cfg7qgpdhJ5WxvZhox4hPIQXV+oR0FgkTClxqj+G19g=; b=TcQF8tqLr0aeBRyvlhVpL2ZTYWkwFS10dDwhmYWXGpeRsvB0C70lUQVTUSjgAYsckp TBIvowx3cz3TGfgNu9zlz5l9NkxMq4fKkVVObzw+xlKPrJibxd0rsi9B5kF5P5y7obek hSBstDvDz2aw3U4wVZtWWLbqV49OhcFh1M8Tvy2r3rR/fI3rtmJt7zgJtqSNwZco69Ab XRUw5+/AurtB1VA/JV8sI1hOuiHHgv3Cf2oJITJMlZntfQI2zMf5BbZM+5kxzsbbVgVV nTx1/VQZ2R5JZWCKCYgEFdxdDT8xiF0714Rou2cpJ/5tc1wvVunyg6Orb5yghP7m43ct iwWQ== X-Gm-Message-State: AOJu0Yz3+7tJNeWqgJjp/Qbw0/wCbQTZo8OaaxIT3NFDqRQWRrydUlXe Fn4EDcy8biZ85unqrDKZorBrW1GQk69xCEwAs4I= X-Google-Smtp-Source: AGHT+IH30w+PmdSuUl42feSZy+dVn/v21Eg2Bq5DYTLlll5DBZcuWGebFdBGWsTfP2Ef9CfwhUh87g== X-Received: by 2002:a17:907:74b:b0:9c7:5667:5648 with SMTP id xc11-20020a170907074b00b009c756675648mr1320671ejb.51.1698389883182; Thu, 26 Oct 2023 23:58:03 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:9ed1:f603:606a:d25e:a194]) by smtp.gmail.com with ESMTPSA id qt7-20020a170906ece700b00988f168811bsm709968ejb.135.2023.10.26.23.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 23:58:02 -0700 (PDT) Message-ID: <40f7af960311be131d6d4bcb2caf7d93b79ddf5c.camel@cybertec.at> Subject: Re: Postgres Partitions Limitations (5.11.2.3) From: Laurenz Albe To: navbarry@gmail.com, pgsql-hackers@lists.postgresql.org Date: Fri, 27 Oct 2023 08:58:02 +0200 In-Reply-To: References: <167299368731.659.16130012959616771853@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-01-09 at 16:40 +0100, Laurenz Albe wrote: > > "Using ONLY to add or drop a constraint on only the partitioned table i= s > > supported as long as there are no partitions. Once partitions exist, us= ing > > ONLY will result in an error. Instead, constraints on the partitions > > themselves can be added and (if they are not present in the parent tabl= e) > > dropped." This seems in contradiction to the example involving adding a > > unique constraint while minimizing locking at the bottom of "5.11.2.2. > > Partition Maintenance", which seems to run fine on my local Pg instance= : > >=20 > > This technique can be used with UNIQUE and PRIMARY KEY constraints too;= the > > indexes are created implicitly when the constraint is created. Example: >=20 > No, that is actually an omission in the documentation. >=20 > The attached patch tries to improve that. I am sending a reply to the hackers list, so that I can add the patch to th= e commitfest. Yours, Laurenz Albe