PGPOOL_SET_CACHE(1)

πŸ“¦
version 4.7.2 Β· 4 versions
, in ubuntu stonking

πŸ’– PGPOOL SET CACHE β€” the manual page, but make it make sense πŸ’–

okay bestie, sit down, we're learning PGPOOL SET CACHE from pgpool-II 4.7.2 and honestly? it's giving one-job-wonder and I respect it. ✨


🌸 NAME 🌸

PGPOOL_SET_CACHE β€” delete query cache πŸ—‘οΈβœ¨


πŸŽ€ SYNOPSIS πŸŽ€

PGPOOL SET CACHE DELETE 'query'

that's it. that's the whole thing. one command, one job, iconic behavior honestly πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the PGPOOL SET CACHE DELETE command deletes the query cache that was previously created by the query. like, it goes and finds that exact cache entry and says bye bye πŸ‘‹

but here's the catch, and it's a real one: the query string has to be exactly identical to the previous query, including the trailing ;. not "close enough". not "spiritually the same". exactly. same characters, same whitespace, same everything. no cap.

and if the query has a ' (single quote) in it? bestie, you gotta prefix it with another ' like this:

PGPOOL SET CACHE DELETE 'SELECT ''FOO'';';

see how the inner quotes got doubled? that's the move 🫢

this command is particularly useful for queries that the auto cache invalidation feature just… doesn't invalidate, because the query doesn't reference any tables at all. auto-invalidation can't touch what it can't see, and our girl PGPOOL SET CACHE DELETE is here to clean up πŸ’–

now, if you don't remember the previous query (been there, lowkey), you can use pcp_invalidate_query_cache(1) to nuke all the query cache β€” including the one you actually wanted gone. but heads up: that one requires the Pgpool-II admin privilege πŸ”

when the deletion works, this command throws you a notice message:

NOTICE:  query cache deleted. query: "query string"

and if the cache doesn't exist, or query cache isn't even enabled, it hits you with:

NOTICE:  query cache does not exist for query: "query string"

still a notice, still cute, just telling you there was nothing to delete πŸ™ˆ


⭐ EXAMPLES ⭐

oops, you accidentally created an unwanted query cache? yeah. happens. delete it with the command, bestie:

test=# /*FORCE QUERY CACHE*/SELECT current_timestamp;
       current_timestamp
-------------------------------
 2024-10-18 18:25:07.826423+09
(1 row)

test=# PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT current_timestamp;';
NOTICE:  query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT current_timestamp;"
SET

ate. no crumbs left πŸ“


🌈 SEE ALSO 🌈


sign-off time πŸŽ€ this whole thing comes from pgpool-II 4.7.2, dated 2023, and it lives under the manual name PGPOOL SET CACHE(1). go forth and delete your caches responsibly, queen πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from