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 1s2zqM-008EXR-Mh for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2024 20:49:22 +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 1s2zqJ-00BrLz-VI for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2024 20:49:20 +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 1s2zqJ-00BrLq-Lz for pgsql-hackers@lists.postgresql.org; Fri, 03 May 2024 20:49:20 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s2zqD-001OhB-Bs for pgsql-hackers@postgresql.org; Fri, 03 May 2024 20:49:19 +0000 Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-36c7004daecso7460585ab.0 for ; Fri, 03 May 2024 13:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714769351; x=1715374151; darn=postgresql.org; 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=nfmSxmii3EvtSwL87RX4iWi6TTIpMWifmDiuv4qW8ew=; b=c3yESmcZSBYkZTPjBPK/gjXlL3u4o8aRDwjRQexRfxEim4PmUmvXlueH9KPsKefhEd 19yHcmMCKNjGZVeVVk+bH8LG+bx2RG2m1XrztcYmRA4VhQfcs7jZ/cmWYuR/1v5/rEuK 36GWeACKse1l8ckMpVdSzsUcRqhH9n56L5xrDeE0b9x6Oc+ophnYmqb8ZIjdt93NnEHt awr2TO3xaZ65005pMv3ZZd6J+OVIrvyWdF8vW6uW9mVei55f4HtZ2GyHloOmmpR8V/gS eNQKdlk6snY4TFuYlCHaw0za8x3FPkZqwrSfiYJc7cxDH5RpFwXI+DVxvTKDVxPNVC3s VQ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714769351; x=1715374151; 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=nfmSxmii3EvtSwL87RX4iWi6TTIpMWifmDiuv4qW8ew=; b=La1Yt4ekTy9J/pkuCRqEigJxHmNExcCCeDgPek98wXsHXHxJFR+tZlnuyrp5oa5/QH T0/d6tE55V4zLYh+6pxPXwWcDRH4i8UyRcXRgmhyvBS8k4M9Kr3ls6gZpI8OZV71roLm p0j3MrDb7tUW7tFYcmLuSh8LpIa+mHiesMKUOb2LHUWAiiRBNEH9BAKWRreAsUdQzXKi oN9zDC6uwPb1pc99BbLTEEM8/V+8F8tMMFXiKtmXAHIbJExlyTBb9PtH2Z+i8lTXhqds z7/fay5rNQRfOjanhyuJBwLW/ngFJ1habjEF3yT2xdacYix8E1cs3plpMaF1yO03EcCw j+yw== X-Forwarded-Encrypted: i=1; AJvYcCXUqsKMLU7hlaqlv/XehfRY5Q14G90/N3ZgCn9vIROQ+Qd2ue6VvjsoNHmIwg/fVJsciGI0TtSfHNCdF7vlLaHdd796fh//PdwM7GwH X-Gm-Message-State: AOJu0YzBtxGUFwNo10uF9ko7k94zzL3ww9VvRT/CU530Qk2K/lO+ExZ6 zENTeq1S/GkotNRc4JSJ4yUbd13Zey18jAs2n8dwk9h3tIbgPPki X-Google-Smtp-Source: AGHT+IFP4IGqxFkwiBC6rrH76pa7+hBTvf95GnAd9FTMoEYELqn3ATFTDBRa+XZAPnws+J/81ZXmlw== X-Received: by 2002:a05:6e02:1a06:b0:36b:6f0:1eb2 with SMTP id s6-20020a056e021a0600b0036b06f01eb2mr3164650ild.16.1714769350891; Fri, 03 May 2024 13:49:10 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id x3-20020a056e021ca300b0036b3735d22dsm809761ill.82.2024.05.03.13.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 13:49:10 -0700 (PDT) Date: Fri, 3 May 2024 15:49:08 -0500 From: Nathan Bossart To: Michael Paquier Cc: Tom Lane , pgsql-hackers@postgresql.org Subject: Re: pg_sequence_last_value() for unlogged sequences on standbys Message-ID: <20240503204908.GA1737291@nathanxps13> References: <20240501005730.GA594666@nathanxps13> <1846474.1714525564@sss.pgh.pa.us> <20240501011317.GC594666@nathanxps13> <20240501020531.GA721953@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, May 01, 2024 at 12:39:53PM +0900, Michael Paquier wrote: > However, it seems to me that you should also drop the > pg_is_other_temp_schema() in system_views.sql for the definition of > pg_sequences. Doing that on HEAD now would be OK, but there's nothing > urgent to it so it may be better done once v18 opens up. Note that > pg_is_other_temp_schema() is only used for this sequence view, which > is a nice cleanup. IIUC this would cause other sessions' temporary sequences to appear in the view. Is that desirable? > By the way, shouldn't we also change the function to return NULL for a > failed permission check? It would be possible to remove the > has_sequence_privilege() as well, thanks to that, and a duplication > between the code and the function view. I've been looking around a > bit, noticing one use of this function in check_pgactivity (nagios > agent), and its query also has a has_sequence_privilege() so returning > NULL would simplify its definition in the long-run. I'd suspect other > monitoring queries to do something similar to bypass permission > errors. I'm okay with that, but it would be v18 material that I'd track separately from the back-patchable fix proposed in this thread. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com