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 1uMwQA-007jiq-Er for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jun 2025 22:17:18 +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 1uMwQ8-0003Xj-02 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jun 2025 22:17:16 +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.94.2) (envelope-from ) id 1uMwQ7-0003Xb-Mu for pgsql-hackers@lists.postgresql.org; Wed, 04 Jun 2025 22:17:16 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uMwQ6-000Ez2-0r for pgsql-hackers@lists.postgresql.org; Wed, 04 Jun 2025 22:17:15 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2352e3db62cso3645095ad.2 for ; Wed, 04 Jun 2025 15:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1749075433; x=1749680233; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=zyPkq05Uuuk03NaaQzRWzupE6DdCsk3z5bzNLWZf+sU=; b=CRGHRLBC8cakwMXx6lOkk2vJFA/ACib0cqenD0EkNqTh5UdWKe6NobkLrv0vdRwlJg qIOxk1SiiWXp/6AX5h6XRJOPZlP9QI0jtBTNvteiSPuAXgarc3pZdqTyI+Tv57WJqT/d frLpVO/N/bz8otIU3ZjETlR6asJ3PPzfY5uno= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749075433; x=1749680233; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zyPkq05Uuuk03NaaQzRWzupE6DdCsk3z5bzNLWZf+sU=; b=sTr65/CG16mLvC9nVJE8Y7cYNnBfWS6w5cO4RaLcwf8quaTZertWFr9R2KhudgnFTj o6r7gSEqvj2HRSon0J2Wh6lbNm/W9R3bBACJvTrMOJcjZ2zGXmdFMo8jZpwJbKVWTFaJ wxGpYbxXeTh8C7mqb87VtZ+BBjrBclmKGbenxQGGKuS+OfUzxO2SQp01T7jOepcSDa0J CCm0aCYszDNLBHoSOq6fKYSQTv/6SmEHH7tVz5+pgT/H5elX9NIrY4JckwRHuYc0d2jd OgBees83W+zLNmNuEytrQ5RfU3Z7bMudjDxaSWCJO3/ocUfzDGUz97V5yFweOrBCY2JH UstQ== X-Forwarded-Encrypted: i=1; AJvYcCW/0OWvmwxRnHVzyPEcnJsaveJjljKqelXL28gD+H7XfUEEg/n+3NF2yJO5IOf18fOitp3W57mZqkCipc5O@lists.postgresql.org X-Gm-Message-State: AOJu0YzXP69Mew8Ly2VTy5DReqOORVYYKEK4dv0lKbNjL5glagCbvw7y T9WoNIRMuf2XQiXtbAftCZ4jkuXUf5XjtlD5FVB0WVwl7m+GJryTd4bqO+1iF19rrQ== X-Gm-Gg: ASbGncs0ZE9i8Xtytu0jjPWdvdqcxSFnNQVHWz4XCiYrRKINVi745NWyJHaKY2r0/wE 8xSWAkrT7R8jPnCybXgjNm2hndZk416iFG7QNS1pGS5ICge+EAGylXStSIZTcbD2z9xlxje7DRO qY4yr2pcdPK2nDKMoI4DWNDNBexyAVS/VlpxDWlBIDaEVOFheL53cxAx/lWz1Mw5LzprwY+8mTh KMsh0UcZMhubG/fqnHSUkWoOCbt1dwubrgWNpsIXjtx5OTlqPCZbD7qjxwQ7fhZKfVzlVjaUSh+ DXnHZLoBR1OwwT3yudj1Zkz+w7GX3lTVLxSR+VHXMqEmnDdz/QlUf4GSaqY= X-Google-Smtp-Source: AGHT+IGXSHhTKMF1wuR8YHt3ai4OzjPugpFU34elnT2agWF6sAVH7/4p/wgivXCnSPBQrY/cqTD2iA== X-Received: by 2002:a17:903:2b05:b0:234:9374:cfae with SMTP id d9443c01a7336-235e1138e92mr69561665ad.19.1749075433314; Wed, 04 Jun 2025 15:17:13 -0700 (PDT) Received: from google.com ([2601:647:5600:80d0::31cd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-235e7322a81sm12578715ad.66.2025.06.04.15.17.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jun 2025 15:17:12 -0700 (PDT) Date: Wed, 4 Jun 2025 15:17:10 -0700 From: Noah Misch To: Bruce Momjian , Tom Lane Cc: "David G. Johnston" , PostgreSQL-development Subject: Re: PG 18 release notes draft committed Message-ID: <20250604221710.2c.nmisch@google.com> References: <20250603172123.5f.nmisch@google.com> <1071973.1749075038@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1071973.1749075038@sss.pgh.pa.us> User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 04, 2025 at 06:10:38PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > I think we have to keep the non-SECURITY-DEFINER designation to keep the > > text accurate, I don't see it that way, because there's currently no experiment the user can perform to distinguish between the following alternatives: 1. We switch to the user that fired the trigger, then call the SECURITY DEFINER function. As always, the first step of executing a SECURITY DEFINER function is to switch to its owner. 2. We know it's a SECURITY DEFINER function, so we don't switch. We just call the SECURITY DEFINER function. As always, the first step of executing a SECURITY DEFINER function is to switch to its owner. The actual implementation is (1), for what it's worth. The src/backend part of the commit didn't special-case SECURITY DEFINER. > but you are right it is part of the function, not the > > trigger: > > > Execute deferred constraint triggers attached to > > non-SECURITY-DEFINER functions as the role that was active at > > the time the trigger was fired > > > Previously such triggers were run as the role that was active at > > commit/execution time. > It's still inaccurate -- to my mind, a "deferred" trigger is one that > runs later than the end of the triggering statement. I think you > should use "after trigger". Also, "fired" is a fairly confusing > choice of word here; I think most people would take that as meaning > the act of running the trigger. How about > > Execute AFTER triggers as the role that was active at the > moment the trigger event was queued > > Previously such triggers were run as the role that is active > when it is time to execute the trigger (e.g., at COMMIT). I like that.