Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Jim Nasby <jim.nasby@gmail.com>
From: Jim Nasby <jim.nasby@gmail.com>
To: Cédric Villemain <cedric.villemain+pgsql@abcsql.com>, Palak Chaturvedi <chaturvedipalak1911@gmail.com>, Nitin Jadhav <nitinjadhavpostgres@gmail.com>, pgsql-hackers@postgresql.org, Thomas Munro <thomas.munro@gmail.com>
Date: 2024-01-03T23:15:11Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add pg_buffercache_evict() function for testing.
- 13453eedd3f6 17.0 landed
Attachments
- (unnamed) (text/html)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 1/3/24 10:25 AM, Cédric Villemain
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:8b8c709a-c7cc-4965-8296-64f549c27501@abcsql.com">Hi
Palak,
<br>
<br>
I did a quick review of the patch:
<br>
<br>
+CREATE FUNCTION pg_buffercache_invalidate(IN int, IN bool default
true)
<br>
+RETURNS bool
<br>
+AS 'MODULE_PATHNAME', 'pg_buffercache_invalidate'
<br>
+LANGUAGE C PARALLEL SAFE;
<br>
<br>
--> Not enforced anywhere, but you can also add a comment to
the function, for end users...
<br>
</blockquote>
<p>The arguments should also have names...</p>
<blockquote type="cite"
cite="mid:8b8c709a-c7cc-4965-8296-64f549c27501@abcsql.com"><br>
+ force = PG_GETARG_BOOL(1);
<br>
<br>
I think you also need to test PG_ARGISNULL with force parameter.
<br>
</blockquote>
Actually, that's true for the first argument as well. Or, just mark
the function as STRICT.<br>
<pre class="moz-signature" cols="72">--
Jim Nasby, Data Architect, Austin TX</pre>
</body>
</html>