You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pg_buffercache provides dirty flag implementation which could be checked like this:
-- Cache, ordered by the number of buffersSELECTpn.nspnameAS schema, pc.relname, count(1) AS buffers, sum(pb.isdirty :: INT) AS dirty_pages
FROM pg_buffercache pb
JOIN pg_class pc ONpb.relfilenode= pg_relation_filenode(pc.oid) --ANDpb.reldatabaseIN(0,
(SELECToidFROM pg_database
WHERE datname = current_database()))
JOIN pg_namespace pn ONpn.oid=pc.relnamespaceGROUP BYpc.relname, pn.nspnameORDER BY buffers DESC;
It'd be nice to operate pg_drop_rel_cache() safely, that is not to clear the cache if any pages are dirty. You can return result and/or some messages to indicate this outcome.
The text was updated successfully, but these errors were encountered:
pg_buffercache
provides dirty flag implementation which could be checked like this:It'd be nice to operate
pg_drop_rel_cache()
safely, that is not to clear the cache if any pages are dirty. You can return result and/or some messages to indicate this outcome.The text was updated successfully, but these errors were encountered: