/*------------------------------------------------------------------------- * cfs_sql.h * Compressed File Store (CFS) — SQL interface functions. * * Declares the backend SQL-callable functions that expose CFS observability * and administration to users: * * pg_cfs_relation_info(regclass) effective policy snapshot * pg_cfs_relation_size(regclass) logical/physical sizes * pg_cfs_check(regclass, deep boolean) structural integrity check * pg_cfs_reset_stats(regclass) reset statistics counters * pg_cfs_estimate_compression(regclass, ...) dry-run compression estimate * * pg_stat_get_cfs() backing SRF for pg_stat_cfs * pg_get_cfs_settings() backing SRF for pg_cfs_settings * * pg_cfs_bgworker_pause(interval) suspend automatic compaction * pg_cfs_bgworker_resume() resume automatic compaction * pg_cfs_bgworker_status() bgworker pause/cycle status * * pg_cfs_compact(regclass) is implemented in cfs_bgworker.c (it shares the * compaction algorithm with the background worker). * * Every function is compiled unconditionally so that pg_proc.dat always * resolves the symbol; the !USE_CFS branch raises a clear "feature not * supported" error. * * Copyright (c) 2026, Kirillov Vyacheslav by AI, QDB Development Group * * IDENTIFICATION * src/include/storage/cfs/cfs_sql.h * *------------------------------------------------------------------------- */ #ifndef CFS_SQL_H #define CFS_SQL_H #include "postgres.h" #include "fmgr.h" /* Single-row informational functions. */ extern Datum pg_cfs_relation_info(PG_FUNCTION_ARGS); extern Datum pg_cfs_relation_size(PG_FUNCTION_ARGS); extern Datum pg_cfs_check(PG_FUNCTION_ARGS); extern Datum pg_cfs_reset_stats(PG_FUNCTION_ARGS); extern Datum pg_cfs_estimate_compression(PG_FUNCTION_ARGS); /* Set-returning functions backing the monitoring views. */ extern Datum pg_stat_get_cfs(PG_FUNCTION_ARGS); extern Datum pg_get_cfs_settings(PG_FUNCTION_ARGS); /* Background worker control functions. */ extern Datum pg_cfs_bgworker_pause(PG_FUNCTION_ARGS); extern Datum pg_cfs_bgworker_resume(PG_FUNCTION_ARGS); extern Datum pg_cfs_bgworker_status(PG_FUNCTION_ARGS); /* Shared block-map segment pool statistics. */ extern Datum pg_cfs_map_pool(PG_FUNCTION_ARGS); #endif /* CFS_SQL_H */