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 1mgssN-0003js-0B for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Oct 2021 18:14:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mgssL-00016x-Rp for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Oct 2021 18:14:41 +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 1mgssL-00016o-Dk for pgsql-hackers@lists.postgresql.org; Sat, 30 Oct 2021 18:14:41 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mgssJ-0008I4-9S for pgsql-hackers@postgresql.org; Sat, 30 Oct 2021 18:14:40 +0000 Received: by mail-pf1-x431.google.com with SMTP id m14so12380453pfc.9 for ; Sat, 30 Oct 2021 11:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=SenFCuaqbvkAC0jIB8Fek9jA4pFrmNbZPWu/KqyzqPU=; b=l+yBpi/R3DIGVnW+a/4J2x8U3kYcgWFZjmghF3bkPP55/S5LuT7X7T+fBKW0zIXXKM jfPZSP4wBS9EJHuLJGjVrm5Ja/7N1SGOaNgjLQvDENvNE3w/r6Fi3h0TzqgdIyn+AcCh 41oP+baE54eBxwkgLZA7ybC1/GOEGm+lhNuJ2M1Wj4MIYDjXoVnMDA+T7ekIClhfaouw Rzj6ci7yu1YAOYaNX5ZSo67zzKnsNjZY7+NwlYOnxB+Hy6uZTMBZayyCGO45IzDbb3ec 45jO9bBMwvdt9D6LXG2OJVK7iZ3BtDBsBWm3a84F8UmlATqDb3DBnJKPaLxcTU/4U1i9 oqOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=SenFCuaqbvkAC0jIB8Fek9jA4pFrmNbZPWu/KqyzqPU=; b=KiFq5aUthKT98KaoXNYTfqmxNpNXeNI2JJFr8N3DgxoWgk9+XhpG0w7S2L/DnzwPFb JNbFHdgJJwTlxf1Q3klD5/iy5IIw+WFWkL/QPj/XFMSjrrHD5tmdAlLw3vUhUX/OK5pX pD7t66/reyFkUT1m53zDrIaG9JScx8GLSYjF93n5pQ3qLUyKNIsV+H5fvdiBA9ZKuxAV JHLB1QLFiYwMkt7cbaiz7MIwaGO2I3dEhJxwf8aVJnmTa4wuE0ZdUlF2XVca+udcF65h UG9tXrRuI2Vf/i/2m0Fm+e85azAxD4uy9dgjslXLC9jG+P6FzkDdupqDdh9meSuI4+em gLuw== X-Gm-Message-State: AOAM530v8Cnue21f5MQdtAuyzRB7FsMi7KquQcGUx0fOJEEDXApZqwc4 kFaJsF97uanDKbfomD1mh378PA== X-Google-Smtp-Source: ABdhPJz2IlfGjg3aUWJ8VMhhnvoU3qs6KTtyII5IJ+nJuE+4Q2hGMrG67rv67ijNluoXlSl/4RqGAg== X-Received: by 2002:a63:e613:: with SMTP id g19mr13984616pgh.12.1635617677580; Sat, 30 Oct 2021 11:14:37 -0700 (PDT) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id s28sm8777730pgo.86.2021.10.30.11.14.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Oct 2021 11:14:37 -0700 (PDT) Message-ID: <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com> Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT. From: Jeff Davis To: Bharath Rupireddy , "Bossart, Nathan" Cc: Stephen Frost , Alvaro Herrera , PostgreSQL-development Date: Sat, 30 Oct 2021 11:14:35 -0700 In-Reply-To: References: <202110252055.soecywkiu6gi@alvherre.pgsql> <0282D099-11ED-45AE-93DB-E0B974F485DF@amazon.com> <06ee895767b46f631327d7e029d46106a8a6fbe9.camel@j-davis.com> <20211026200255.GO20998@tamriel.snowman.net> <423ff64d88c6817551ea81e0b554202992184bac.camel@j-davis.com> <55A4CF15-D562-4F1F-B078-DAF19A39CBF4@amazon.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2021-10-30 at 13:24 +0530, Bharath Rupireddy wrote: > IMHO, moving away from SQL command "CHECKPOINT" to function > "pg_checkpoint()" isn't nice as the SQL command has been there for a > long time and all the applications or services that were/are being > built around the postgres ecosystem would have to adapt someday to > the > new function (if at all we deprecate the command and onboard the > function). This isn't good at all given the CHECKPOINT is one of the > mostly used commands in the apps or services layer. Moreover, if we > go > with the function pg_checkpoint(), we might see patches coming in for > pg_vacuum(), pg_reindex(), pg_cluster() and so on. I tend to agree with all of this. The CHECKPOINT command is already there and people already use it. If we are already chipping away at the need for superuser elsewhere, we should offer a way to use CHECKPOINT without being superuser. If the purpose[0] of predefined roles is that they allow you to do things that can't be expressed by GRANT, a predefined role pg_checkpointer seems to fit the bill. The main argument against[1] having a pg_checkpointer predefined role is that it creates a clutter of predefined roles. But it seems like just another part of the clutter of having a special SQL command merely for requesting a checkpoint. The alternative of creating a new function doesn't seem to alleviate the clutter. Some people will use the function and some will use the command, creating inconsistency in examples and scripts, and people will wonder which one is the "right" one. Regards, Jeff Davis [0] https://postgr.es/m/CA+TgmobQoWZn62qWRX+OOFjBPhdubxYTBeO-GSNPcLvBHh4ZvA@mail.gmail.com [1] https://postgr.es/m/8C661979-AF85-4AE1-9E2B-2A091DA3DB22@amazon.com