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 1rLASJ-006SUT-II for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2024 23:15:23 +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 1rLASG-008ja2-0Z for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2024 23:15: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 1rLASF-008jZu-L5 for pgsql-hackers@lists.postgresql.org; Wed, 03 Jan 2024 23:15:19 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rLASD-00FPLm-9g for pgsql-hackers@postgresql.org; Wed, 03 Jan 2024 23:15:19 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1f055438492so8250366fac.3 for ; Wed, 03 Jan 2024 15:15:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704323715; x=1704928515; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lfxGKxqlSKeyUd7y3HoZU1Ht7FpM0y1XawDeU1lK4VA=; b=PDDrqBxYc+XQ3zZacczNNQwtk59dsTjglctTa2WbOVabrrKOux3+yPaTD8jNvYBMI0 SCRn641qCDYCuKX+cjOoGAvHyUH2akZJ/+YjJDJ3Novlwt/UvAh7sbPVMGz+ZJKs1iFr raeMfIjYxtuQVNy/bMoXTI3kVqjSr+BGp0QjRpLcA9FTiNTGPSoKcy7gBr4rWnrKtpVY 7Odvva3PmgA/SZq2XEgpvI7hgXFB/Nu9fZTodqJ0kSqBT0YoOPB3GtISDnjStuAYfUSr hRKrScJ/4O+uhizfIYap5ZTGLcH22mVoNUQAK9MMxjoTut0nOG7Dr4s5FlOLm/jN8D8h dv1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704323715; x=1704928515; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lfxGKxqlSKeyUd7y3HoZU1Ht7FpM0y1XawDeU1lK4VA=; b=RntpxZk65fzi3F4gS92EAMFN/7+gULw2qcZs1JtfV0Yei7xNzbPs2WJH+ycgqgGVRR OupA1mGwuRrHBFm3wkRKtzv+GqeBc40OnG/PBQwnucJ2bYqMXi/r5d3+ciUKH5Ic1XtR 3LeUD/2PmOsH8KhbtavGExOgMAbFufElQgIfie3LPUnzXXtGZ2wanuAJvS8z8+x4AWta QU7/o8Dcr8Y7DZ9r/V/5rwz8W1kpJcEVNrpw5IhcmyF+2FMPNe+2eV5hQW0MyOi70bbQ wjB4kU1884MCWH7ggARGRInuy5u4lr3gdrIAaIm2xbDxFONnjXuBDa0qasieHY2Wmc/k RUaw== X-Gm-Message-State: AOJu0Yzg5qzfppmCThj5VqNNo//7UbpDMTKj8k2ZmFJEPlADXgiiCtjh wMMjX/XN8DgJzy/rcUdwGA== X-Google-Smtp-Source: AGHT+IFH49A7ZFUi8pOVrYwUyONRnUQAAXC3VIZqkcfWpwMVvCv91GiCnKzE8yeznXA5G6tPJazvQg== X-Received: by 2002:a05:6870:e38d:b0:204:2bc4:87c9 with SMTP id x13-20020a056870e38d00b002042bc487c9mr21995434oad.86.1704323714762; Wed, 03 Jan 2024 15:15:14 -0800 (PST) Received: from [192.168.2.9] (070-113-014-216.res.spectrum.com. [70.113.14.216]) by smtp.gmail.com with ESMTPSA id cq20-20020a056808371400b003b9f057de84sm3884188oib.58.2024.01.03.15.15.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jan 2024 15:15:14 -0800 (PST) Message-ID: <3510716d-d3f3-40c8-9f7f-d644171acfb6@gmail.com> Date: Wed, 3 Jan 2024 17:15:11 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Extension Enhancement: Buffer Invalidation in pg_buffercache Content-Language: en-US To: =?UTF-8?Q?C=C3=A9dric_Villemain?= , Palak Chaturvedi , Nitin Jadhav , pgsql-hackers@postgresql.org, Thomas Munro References: <8b8c709a-c7cc-4965-8296-64f549c27501@abcsql.com> From: Jim Nasby In-Reply-To: <8b8c709a-c7cc-4965-8296-64f549c27501@abcsql.com> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk
On 1/3/24 10:25 AM, Cédric Villemain wrote:
Hi Palak,

I did a quick review of the patch:

+CREATE FUNCTION pg_buffercache_invalidate(IN int, IN bool default true)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pg_buffercache_invalidate'
+LANGUAGE C PARALLEL SAFE;

--> Not enforced anywhere, but you can also add a comment to the function, for end users...

The arguments should also have names...


+    force = PG_GETARG_BOOL(1);

I think you also need to test PG_ARGISNULL with force parameter.
Actually, that's true for the first argument as well. Or, just mark the function as STRICT.
-- 
Jim Nasby, Data Architect, Austin TX