Add data for WAL in pg_stat_io and backend statistics
[pgsql.git] / src / include / catalog / meson.build
blobec1cf467f6fa067bf7f76b4e20484be445cdabc2
1 # Copyright (c) 2022-2025, PostgreSQL Global Development Group
3 # Note: the order of this list determines the order in which the catalog
4 # header files are assembled into postgres.bki.  BKI_BOOTSTRAP catalogs
5 # must appear first, and pg_statistic before pg_statistic_ext_data, and
6 # there are reputedly other, undocumented ordering dependencies.
7 catalog_headers = [
8   'pg_proc.h',
9   'pg_type.h',
10   'pg_attribute.h',
11   'pg_class.h',
12   'pg_attrdef.h',
13   'pg_constraint.h',
14   'pg_inherits.h',
15   'pg_index.h',
16   'pg_operator.h',
17   'pg_opfamily.h',
18   'pg_opclass.h',
19   'pg_am.h',
20   'pg_amop.h',
21   'pg_amproc.h',
22   'pg_language.h',
23   'pg_largeobject_metadata.h',
24   'pg_largeobject.h',
25   'pg_aggregate.h',
26   'pg_statistic.h',
27   'pg_statistic_ext.h',
28   'pg_statistic_ext_data.h',
29   'pg_rewrite.h',
30   'pg_trigger.h',
31   'pg_event_trigger.h',
32   'pg_description.h',
33   'pg_cast.h',
34   'pg_enum.h',
35   'pg_namespace.h',
36   'pg_conversion.h',
37   'pg_depend.h',
38   'pg_database.h',
39   'pg_db_role_setting.h',
40   'pg_tablespace.h',
41   'pg_authid.h',
42   'pg_auth_members.h',
43   'pg_shdepend.h',
44   'pg_shdescription.h',
45   'pg_ts_config.h',
46   'pg_ts_config_map.h',
47   'pg_ts_dict.h',
48   'pg_ts_parser.h',
49   'pg_ts_template.h',
50   'pg_extension.h',
51   'pg_foreign_data_wrapper.h',
52   'pg_foreign_server.h',
53   'pg_user_mapping.h',
54   'pg_foreign_table.h',
55   'pg_policy.h',
56   'pg_replication_origin.h',
57   'pg_default_acl.h',
58   'pg_init_privs.h',
59   'pg_seclabel.h',
60   'pg_shseclabel.h',
61   'pg_collation.h',
62   'pg_parameter_acl.h',
63   'pg_partitioned_table.h',
64   'pg_range.h',
65   'pg_transform.h',
66   'pg_sequence.h',
67   'pg_publication.h',
68   'pg_publication_namespace.h',
69   'pg_publication_rel.h',
70   'pg_subscription.h',
71   'pg_subscription_rel.h',
74 # The .dat files we need can just be listed alphabetically.
75 bki_data = [
76   'pg_aggregate.dat',
77   'pg_am.dat',
78   'pg_amop.dat',
79   'pg_amproc.dat',
80   'pg_authid.dat',
81   'pg_cast.dat',
82   'pg_class.dat',
83   'pg_collation.dat',
84   'pg_conversion.dat',
85   'pg_database.dat',
86   'pg_language.dat',
87   'pg_namespace.dat',
88   'pg_opclass.dat',
89   'pg_operator.dat',
90   'pg_opfamily.dat',
91   'pg_proc.dat',
92   'pg_range.dat',
93   'pg_tablespace.dat',
94   'pg_ts_config.dat',
95   'pg_ts_config_map.dat',
96   'pg_ts_dict.dat',
97   'pg_ts_parser.dat',
98   'pg_ts_template.dat',
99   'pg_type.dat',
101 bki_data_f = files(bki_data)
104 input = []
105 output_files = [
106   'postgres.bki',
107   'system_constraints.sql',
108   'schemapg.h',
109   'syscache_ids.h',
110   'syscache_info.h',
111   'system_fk_info.h',
113 output_install = [
114   dir_data,
115   dir_data,
116   dir_include_server / 'catalog',
117   dir_include_server / 'catalog',
118   false,
119   dir_include_server / 'catalog',
122 foreach h : catalog_headers
123   fname = h.split('.h')[0] + '_d.h'
124   input += files(h)
125   output_files += fname
126   output_install += dir_include_server / 'catalog'
127 endforeach
129 generated_catalog_headers = custom_target('generated_catalog_headers',
130   output: output_files,
131   install_dir: output_install,
132   input: input,
133   depend_files: bki_data_f + catalog_pm,
134   build_by_default: true,
135   install: true,
136   command: [
137     perl,
138     files('../../backend/catalog/genbki.pl'),
139     '--include-path=@SOURCE_ROOT@/src/include',
140     '--set-version=' + pg_version_major.to_string(),
141     '--output=@OUTDIR@', '@INPUT@'
142   ],
145 generated_headers += generated_catalog_headers.to_list()
147 # autoconf generates the file there, ensure we get a conflict
148 generated_sources_ac += {'src/include/catalog': output_files + ['bki-stamp']}
150 # 'reformat-dat-files' is a convenience target for rewriting the
151 # catalog data files in our standard format.  This includes collapsing
152 # out any entries that are redundant with a BKI_DEFAULT annotation.
153 run_target('reformat-dat-files',
154   command: [perl, files('reformat_dat_file.pl'), '--output', '@CURRENT_SOURCE_DIR@', bki_data_f],
157 # 'expand-dat-files' is a convenience target for expanding out all
158 # default values in the catalog data files.  This should be run before
159 # altering or removing any BKI_DEFAULT annotation.
160 run_target('expand-dat-files',
161   command: [perl, files('reformat_dat_file.pl'), '--output', '@CURRENT_SOURCE_DIR@', bki_data_f, '--full-tuples'],