Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*-------------------------------------------------------------------------
 * 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 */