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.96) (envelope-from ) id 1whB0W-0003W9-2w for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 18:59:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whAzV-002GDG-0F for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 18:57:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whAzU-002GD8-1j for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 18:57:57 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whAzT-000000001vW-008Q for pgsql-hackers@postgresql.org; Tue, 07 Jul 2026 18:57:56 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-8478fe07f65so24350b3a.0 for ; Tue, 07 Jul 2026 11:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1783450674; x=1784055474; darn=postgresql.org; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=23MNavKlguss1T3vHUs1MlZ0oEKTb5BVYxdmsiJ3ifM=; b=YRxG1ly6M1CXWQhbSSN0vRyfYtcgmLy9mSMziLL30heSDdmycXszI0I6EUf1YB6R80 vnpi+nHt+ks2+r6OOGTmxMuKpp9WqjEk+w5QToXp/UoAlXOg6yeBZQDGuJPDpYq8wSC+ wXcU8AZ8Dgc9iKaTtjIwFgPubyBQBwc1n3uA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783450674; x=1784055474; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=23MNavKlguss1T3vHUs1MlZ0oEKTb5BVYxdmsiJ3ifM=; b=mAo1kfCPoAHoe4ZgV6Z1XspeyAT/Af5h/hdjhl6Va5iOLxZbeU2ROPKB5PqEIhwzF9 znlLGsNDzHrSycvRLuMGZDUZLfWalmqWKJ+hTLi40Iv48ByncdJWRYUgr1VIPkNpLn3m gukIkJX0W04TXYMnDy7MD88CKQgUAJ+WSTZrcCT6CA7sB+eto1GLn1aZzMzEbt1MM3iS aXNVAF57xhc95QK/8y2vjgo4IPcm82HrKBNJU3eeLf1NCBNP895jSIpzO4aHblX0+Yw5 AaSRQOsf3qGkjxIWGktE2XNRyJAFR0TD0Jjlo1rhxhXQ7Wp/uuDstb24g/c21TVBCTs7 MPzA== X-Gm-Message-State: AOJu0YxGbJY/L/AfHFZxK58hy5w51JSAIZHSQGeW5EbfrDcODOcLKb/f crrYwiI3NgmDWg/PRXMekRq2qOPFqHwmFRilvhulsaXyzovRzyjdCEb8UbboPimtMA== X-Gm-Gg: AfdE7cnkDhCezKklIpab0RGHirO8Oy0OrqGXagLbHJ2MaSG/Y7L90HwuIb1WRRSLAr2 KtxiUaAQeXe9+B4Sea/SBtTMWKofpb4KY+N/s0TvcTQX9WbKdDc/gseJe2oyWNbWum6dzgomRkc MApzw+Qh+WJB8aH6/Zp/TsQiimQDfTMKdRnEkXIr3Xra4Epn5umnzYSotkbd6T8BBL/ZjYhMXhZ B8krEk+dmTOoLkCdYYufD0KZK6vm0cbnPQM0CL4KmcNlrlaKzwVHKztDXtqVIUHrd6LpX2TYPZR RNWEojgidumWsBoMNYC6olACmPuhheC430wN9zHbthkb6n8QzKxbSI2ZRC2Ey4UNe3ADK3/o64v wM2lyQ6sCLv1fcTD8gobgepqJ83QKcUenPki7i+i143GM/2JAjMFQiUYDqdyUQQpgNTZxbZBIxv XwKsO9E+ZcnMR/3bZ2XHOmAPHMkrpZIB6rnIhKGHppzZyX X-Received: by 2002:a05:6a00:1bc9:b0:845:e6fc:150a with SMTP id d2e1a72fcca58-84826bfc056mr5934896b3a.13.1783450674191; Tue, 07 Jul 2026 11:57:54 -0700 (PDT) Received: from microsoft.com (c-73-15-160-255.hsd1.ca.comcast.net. [73.15.160.255]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847f6d76106sm5906285b3a.40.2026.07.07.11.57.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2026 11:57:53 -0700 (PDT) Date: Tue, 7 Jul 2026 11:57:51 -0700 From: Noah Misch To: d.koval@postgrespro.ru, aekorotkov@gmail.com Cc: pgsql-hackers@postgresql.org Subject: SPLIT/MERGE use of is_internal=true Message-ID: <20260707185751.f9.noahmisch@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/2.3.0 (2026-01-25) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk commit f2e4cc4 wrote: > +/* > + * createPartitionTable: > + * > + * Create a new partition (newPartName) for the partitioned table (parent_rel). > + * ownerId is determined by the partition on which the operation is performed, > + * so it is passed separately. The new partition will inherit the access method > + * and persistence type from the parent table. > + * > + * Returns the created relation (locked in AccessExclusiveLock mode). > + */ > +static Relation > +createPartitionTable(List **wqueue, RangeVar *newPartName, > + Relation parent_rel, Oid ownerId) > +{ ... > + /* Create the relation. */ > + newRelId = heap_create_with_catalog(newPartName->relname, > + namespaceId, > + parent_relform->reltablespace, > + InvalidOid, > + InvalidOid, > + InvalidOid, > + ownerId, > + relamId, > + descriptor, > + NIL, > + RELKIND_RELATION, > + newPartName->relpersistence, > + false, > + false, > + ONCOMMIT_NOOP, > + (Datum) 0, > + true, > + allowSystemTableMods, > + true, > + InvalidOid, > + NULL); This and other places in the SPLIT/MERGE patches pass is_internal=true, which ultimately flows to hooks with the following meaning: /* * If this flag is set, the user hasn't requested that the object be * altered, but we're doing it anyway for some internal reason. * Permissions-checking hooks may want to skip checks if, say, we're alter * the constraints of a temporary heap during CLUSTER. */ bool is_internal; SPLIT/MERGE constitute user requests to create and/or drop tables, so they're not like a CLUSTER temporary heap. They should pass is_internal=false, like when the user runs CREATE/DROP directly.