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 1mXswx-0003JP-LT for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Oct 2021 22:30:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mXsww-00014m-C4 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Oct 2021 22:30:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXswv-00014e-VA for pgsql-hackers@lists.postgresql.org; Tue, 05 Oct 2021 22:30:14 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mXswt-0007Pw-0U for pgsql-hackers@lists.postgresql.org; Tue, 05 Oct 2021 22:30:13 +0000 Received: by mail-pj1-x102e.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so3068888pjc.3 for ; Tue, 05 Oct 2021 15:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ardentperf-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=j/6gk0PE4tif7YTlyZJ5Ngc6lXa2o8WyEOvZ6Gew0UE=; b=ParrT5uhXXAN0JK7h9B+NIj33zUP8nH8Wh0JQ812U256W+2OXZUDRDSWZeQf3Vn+BA +bej1fjFHoTPYqDWnCchsLPT/MB1G+upblmSPwGqIRg7y2z8BWt96ud742TU4g7nRLng UcYKJ+4kkzoIuL78Dx3ILe4t6mq3o8ZHr0Ea7pO/LeJXOPa8EzctGfqfwTvFMlJGqvps tlcyWSCvb6pWvNyXSVCcnekIO9J2MPKX+fRZdWZ7TRd8BfsvCjDjfLmga6nTtPodT4Zg 49XZ2H8y3Sm6s2NM2XEt2NAywymGEXZwsMI2nuF5fNx/2I/VAPR7dmzTHRgqm4hsWNFb +FWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=j/6gk0PE4tif7YTlyZJ5Ngc6lXa2o8WyEOvZ6Gew0UE=; b=VEMYK2GwGLXYKUVTewascXKF4e5yOKPSqYUSrCJ3ZD9eryrUikRV1onCDN7LQ+b9Os qHreaCePyjQYvDMMvX2sRMUjM1pdMkZEXG+yPD2iBQll9vunMkEfY9lsgrS9Eib0eOar DSX14E3xiRzELeNM/o2GoPWYDURy/1xxNblytw9GiBzldgT4eqoWsxwa4vcSe91mvukS QcBGSad5LgsTzBsF8/WewI9e5s7oHHhloJyRKztP5DBQMo3ZjyJdp6+EZklyHTB8+asi TFDFd1pHTVH41V+XA7abu4gMK7FRMJxwkjuaXCtrtssvJTPjzPZKe5zNOBe7e/YQR+Yt kP9w== X-Gm-Message-State: AOAM53101CxJpGs+aFLp+c7jB4xZT3cguTz0E/OPDbF9zLEUVcCOFmQJ mgJTGm9ngvoxx2mjDUEQLBpCQQ== X-Google-Smtp-Source: ABdhPJz/1XZJnSoboO6DgsgeV/nIlrzyMxSFi3il5nhM3R7wE5kyjEeO7okPlHSnf/7SsvjYSrROGg== X-Received: by 2002:a17:90b:374f:: with SMTP id ne15mr6697511pjb.37.1633473008662; Tue, 05 Oct 2021 15:30:08 -0700 (PDT) Received: from [10.111.232.14] (54-240-196-190.amazon.com. [54.240.196.190]) by smtp.gmail.com with ESMTPSA id n26sm19054420pfo.19.2021.10.05.15.30.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 15:30:08 -0700 (PDT) Message-ID: <47c04e88-7df8-963c-e32e-491260a09691@ardentperf.com> Date: Tue, 5 Oct 2021 15:30:07 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: pg_walinspect - a new extension to get raw WAL data and WAL stats Content-Language: en-US To: Bruce Momjian , Bharath Rupireddy Cc: PostgreSQL Hackers , satyanarlapuram@gmail.com, marvin_liang@qq.com, actyzhang@outlook.com, Ashutosh Sharma References: <20211005220707.GC24555@momjian.us> From: Jeremy Schneider In-Reply-To: <20211005220707.GC24555@momjian.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/5/21 15:07, Bruce Momjian wrote: > On Wed, Sep 8, 2021 at 07:18:08PM +0530, Bharath Rupireddy wrote: >> While working on one of the internal features, we found that it is a >> bit difficult to run pg_waldump for a normal user to know WAL info and >> stats of a running postgres database instance in the cloud. Many a >> times users or DBAs or developers would want to get and analyze >> following: > > Uh, are we going to implement everything that is only available at the > command line as an extension just for people who are using managed cloud > services where the command line is not available and the cloud provider > has not made that information accessible? Seems like this might lead to > a lot of duplicated effort. No. For most command line utilities, there's no reason to expose them in SQL or they already are exposed in SQL. For example, everything in pg_controldata is already available via SQL functions. Specifically exposing pg_waldump functionality in SQL could speed up finding bugs in the PG logical replication code. We found and fixed a few over this past year, but there are more lurking out there. Having the extension in core is actually the only way to avoid duplicated effort, by having shared code which the pg_dump binary and the extension both wrap or call. -Jeremy -- http://about.me/jeremy_schneider