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 1pFl5K-0006nh-LO for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jan 2023 00:04:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFl5I-0001VY-Fd for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jan 2023 00:04:44 +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 1pFl5I-0001VP-4L for pgsql-hackers@lists.postgresql.org; Thu, 12 Jan 2023 00:04:44 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pFl5F-00028q-7r for pgsql-hackers@postgresql.org; Thu, 12 Jan 2023 00:04:43 +0000 Received: by mail-pj1-x1029.google.com with SMTP id z4-20020a17090a170400b00226d331390cso19011137pjd.5 for ; Wed, 11 Jan 2023 16:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=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=Qn4XLaxEE8UhlWR+FzZzl9Sj7sEjLJCv63C6/EHGkpM=; b=afHZp0MCSpQDvyr+W16W60jlXlLTTb335IGS9+EZ4UE1Y5zLKApB4j4Ejg0xLX6pqs aNYTs82uAgRmhyhbE+ul0iVmubqXKjQFXYDOvdNbHbQwmNLLu2u6xa0LrAapxzM8OUqF cRskWGbGas0d3KrFu0sZ7OVQgN4Du2GoTuKF1dyraVRgi09nJ61KsI55Uonsk09L+1v2 O5R3mLP6viJoDooIaHly+ORyE9sL6uTt7Fuyoejbx0kiwPjZcFak+PezOu1Wi/XbMKNO BX330AC6COb2W+vFy5B6PUw3DisZ8+hxBlC9Jo9UrqAB0T1y3fE6xZDBLbagVePMUyur t4Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=Qn4XLaxEE8UhlWR+FzZzl9Sj7sEjLJCv63C6/EHGkpM=; b=ewREvyC4fXLZdgdP1qwfFnD1BMTLUK4J4xSdWzF87mL9s107avIKNJGDp12e7hWvwx PWVu67HO8a346/Sd6FfbQouPkRxOr9/XjXM78pbh+7z0pCn1xXhU8G+FXKMj0ZVkvt5R 00xy9QeF1MO6j54j5wpgk01jrYzbAY1M0sDsdru64B9ZfW0n3CmxP+mNg2P+w8ue8vMl Y40rcPLx8Q5NzCQCgrGa2Ca7zHE75eH2x8DBb/kJsXm/a6R2jRwKBdKNTru/gyshGvow zaVTB5xfhXqCRsUWrIrYAwqL+Y5baeyqrii2Y73AIxu2uEDJ4WLU8cTOGieZn3j+FOVg 3cHw== X-Gm-Message-State: AFqh2koge40/hmyvUkD7SvSXtEW4qYyXdnRs81CisPju54TJ0gR+S4TT Hv+lHboLlwuPVrH70BP6NMA= X-Google-Smtp-Source: AMrXdXt/kkjYO2UNO1bPgC5qi+B4kc100MvTUwrVm/EyBPLtfKJal4b4oapr7zyNBkttURzkElSOMg== X-Received: by 2002:a17:90a:7503:b0:228:d614:3b79 with SMTP id q3-20020a17090a750300b00228d6143b79mr6481321pjk.15.1673481880066; Wed, 11 Jan 2023 16:04:40 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id b2-20020a655782000000b0047915d582ccsm9023713pgr.20.2023.01.11.16.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 16:04:39 -0800 (PST) Date: Wed, 11 Jan 2023 16:04:37 -0800 From: Nathan Bossart To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: Refactor recordExtObjInitPriv() Message-ID: <20230112000437.GA2032194@nathanxps13> References: <504bc485-6bd6-dd1b-fe10-e7351aeb310d@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <504bc485-6bd6-dd1b-fe10-e7351aeb310d@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Dec 27, 2022 at 09:56:10AM +0100, Peter Eisentraut wrote: > Refactor recordExtObjInitPriv(): Instead of half a dozen of > mostly-duplicate conditional branches, write one common one that can handle > most catalogs. We already have all the information we need, such as which > system catalog corresponds to which catalog table and which column is the > ACL column. This seems reasonable. > + /* This will error on unsupported classoid. */ > + else if (get_object_attnum_acl(classoid)) nitpick: I would suggest explicitly checking that it isn't InvalidAttrNumber instead of relying on it always being 0. > - classoid == AggregateRelationId || I noticed that AggregateRelationId isn't listed in the ObjectProperty array, so I think recordExtObjInitPriv() will begin erroring for that classoid instead of ignoring it like we do today. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com