]> begriffs open source - ai-pg/blob - full-docs/man1/pg_config.1
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man1 / pg_config.1
1 '\" t
2 .\"     Title: pg_config
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "PG_CONFIG" "1" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 pg_config \- retrieve information about the installed version of PostgreSQL
32 .SH "SYNOPSIS"
33 .HP \w'\fBpg_config\fR\ 'u
34 \fBpg_config\fR [\fIoption\fR...]
35 .SH "DESCRIPTION"
36 .PP
37 The
38 pg_config
39 utility prints configuration parameters of the currently installed version of
40 PostgreSQL\&. It is intended, for example, to be used by software packages that want to interface to
41 PostgreSQL
42 to facilitate finding the required header files and libraries\&.
43 .SH "OPTIONS"
44 .PP
45 To use
46 pg_config, supply one or more of the following options:
47 .PP
48 \fB\-\-bindir\fR
49 .RS 4
50 Print the location of user executables\&. Use this, for example, to find the
51 \fBpsql\fR
52 program\&. This is normally also the location where the
53 pg_config
54 program resides\&.
55 .RE
56 .PP
57 \fB\-\-docdir\fR
58 .RS 4
59 Print the location of documentation files\&.
60 .RE
61 .PP
62 \fB\-\-htmldir\fR
63 .RS 4
64 Print the location of HTML documentation files\&.
65 .RE
66 .PP
67 \fB\-\-includedir\fR
68 .RS 4
69 Print the location of C header files of the client interfaces\&.
70 .RE
71 .PP
72 \fB\-\-pkgincludedir\fR
73 .RS 4
74 Print the location of other C header files\&.
75 .RE
76 .PP
77 \fB\-\-includedir\-server\fR
78 .RS 4
79 Print the location of C header files for server programming\&.
80 .RE
81 .PP
82 \fB\-\-libdir\fR
83 .RS 4
84 Print the location of object code libraries\&.
85 .RE
86 .PP
87 \fB\-\-pkglibdir\fR
88 .RS 4
89 Print the location of dynamically loadable modules, or where the server would search for them\&. (Other architecture\-dependent data files might also be installed in this directory\&.)
90 .RE
91 .PP
92 \fB\-\-localedir\fR
93 .RS 4
94 Print the location of locale support files\&. (This will be an empty string if locale support was not configured when
95 PostgreSQL
96 was built\&.)
97 .RE
98 .PP
99 \fB\-\-mandir\fR
100 .RS 4
101 Print the location of manual pages\&.
102 .RE
103 .PP
104 \fB\-\-sharedir\fR
105 .RS 4
106 Print the location of architecture\-independent support files\&.
107 .RE
108 .PP
109 \fB\-\-sysconfdir\fR
110 .RS 4
111 Print the location of system\-wide configuration files\&.
112 .RE
113 .PP
114 \fB\-\-pgxs\fR
115 .RS 4
116 Print the location of extension makefiles\&.
117 .RE
118 .PP
119 \fB\-\-configure\fR
120 .RS 4
121 Print the options that were given to the
122 configure
123 script when
124 PostgreSQL
125 was configured for building\&. This can be used to reproduce the identical configuration, or to find out with what options a binary package was built\&. (Note however that binary packages often contain vendor\-specific custom patches\&.) See also the examples below\&.
126 .RE
127 .PP
128 \fB\-\-cc\fR
129 .RS 4
130 Print the value of the
131 \fICC\fR
132 variable that was used for building
133 PostgreSQL\&. This shows the C compiler used\&.
134 .RE
135 .PP
136 \fB\-\-cppflags\fR
137 .RS 4
138 Print the value of the
139 \fICPPFLAGS\fR
140 variable that was used for building
141 PostgreSQL\&. This shows C compiler switches needed at preprocessing time (typically,
142 \-I
143 switches)\&.
144 .RE
145 .PP
146 \fB\-\-cflags\fR
147 .RS 4
148 Print the value of the
149 \fICFLAGS\fR
150 variable that was used for building
151 PostgreSQL\&. This shows C compiler switches\&.
152 .RE
153 .PP
154 \fB\-\-cflags_sl\fR
155 .RS 4
156 Print the value of the
157 \fICFLAGS_SL\fR
158 variable that was used for building
159 PostgreSQL\&. This shows extra C compiler switches used for building shared libraries\&.
160 .RE
161 .PP
162 \fB\-\-ldflags\fR
163 .RS 4
164 Print the value of the
165 \fILDFLAGS\fR
166 variable that was used for building
167 PostgreSQL\&. This shows linker switches\&.
168 .RE
169 .PP
170 \fB\-\-ldflags_ex\fR
171 .RS 4
172 Print the value of the
173 \fILDFLAGS_EX\fR
174 variable that was used for building
175 PostgreSQL\&. This shows linker switches used for building executables only\&.
176 .RE
177 .PP
178 \fB\-\-ldflags_sl\fR
179 .RS 4
180 Print the value of the
181 \fILDFLAGS_SL\fR
182 variable that was used for building
183 PostgreSQL\&. This shows linker switches used for building shared libraries only\&.
184 .RE
185 .PP
186 \fB\-\-libs\fR
187 .RS 4
188 Print the value of the
189 \fILIBS\fR
190 variable that was used for building
191 PostgreSQL\&. This normally contains
192 \-l
193 switches for external libraries linked into
194 PostgreSQL\&.
195 .RE
196 .PP
197 \fB\-\-version\fR
198 .RS 4
199 Print the version of
200 PostgreSQL\&.
201 .RE
202 .PP
203 \fB\-?\fR
204 .br
205 \fB\-\-help\fR
206 .RS 4
207 Show help about
208 pg_config
209 command line arguments, and exit\&.
210 .RE
211 If more than one option is given, the information is printed in that order, one item per line\&. If no options are given, all available information is printed, with labels\&.
212 .SH "NOTES"
213 .PP
214 The options
215 \fB\-\-docdir\fR,
216 \fB\-\-pkgincludedir\fR,
217 \fB\-\-localedir\fR,
218 \fB\-\-mandir\fR,
219 \fB\-\-sharedir\fR,
220 \fB\-\-sysconfdir\fR,
221 \fB\-\-cc\fR,
222 \fB\-\-cppflags\fR,
223 \fB\-\-cflags\fR,
224 \fB\-\-cflags_sl\fR,
225 \fB\-\-ldflags\fR,
226 \fB\-\-ldflags_sl\fR, and
227 \fB\-\-libs\fR
228 were added in
229 PostgreSQL
230 8\&.1\&. The option
231 \fB\-\-htmldir\fR
232 was added in
233 PostgreSQL
234 8\&.4\&. The option
235 \fB\-\-ldflags_ex\fR
236 was added in
237 PostgreSQL
238 9\&.0\&.
239 .SH "EXAMPLE"
240 .PP
241 To reproduce the build configuration of the current PostgreSQL installation, run the following command:
242 .sp
243 .if n \{\
244 .RS 4
245 .\}
246 .nf
247 eval \&./configure `pg_config \-\-configure`
248 .fi
249 .if n \{\
250 .RE
251 .\}
252 .sp
253 The output of
254 pg_config \-\-configure
255 contains shell quotation marks so arguments with spaces are represented correctly\&. Therefore, using
256 eval
257 is required for proper results\&.