Sample Exam Questions

From the objective of OSS-DB Exam Silver
S2.3 Configuration files (postgresql.conf)

Sample Question


Choose three appropriate explanations for how to write the configuration file postgresql.conf.

  1. For Boolean parameter values, you use on/off, but you can also use t/f, y/n, or 1/0 instead of on/off.

  2. The default units for time parameter values are seconds, but you can explicitly specify units such as 100 ms or 1 min.

  3. The default unit for the value of the parameter that specifies the amount of memory is kilobytes, but you can also specify the unit explicitly, for example, 100 MB or 1 GB.

  4. Values for parameters that specify numeric values are specified in decimal numbers, with the values beginning with 0x interpreted as hexadecimal and values beginning with 0 interpreted as octal numbers.

  5. Values for parameters that specify strings must be enclosed in single quotes, but if the value contains single quotes, two quotation marks must be placed in sequence, for example 'don''t'.

※This sample exam is different from those that appear in the actual OSS-DB Exam.

Answer and Explanation

Parameters set in postgresql.conf can be categorized into Boolean, numeric, string, or enum types. Note that while parameter names are case-insensitive, some values are case-sensitive.

A Boolean value type can have values of on, off, true, false, yes, no, 1, 0, and at least the first character of any of these, provided that it is not ambiguous. Unambiguous means that a single 'o' character cannot be used to determine whether it is 'on' or 'off'; however, 't' or 'f' can be used as they clearly represent 'true' or 'false', respectively. Boolean value types are case-insensitive, so they can be specified in uppercase, such as 'T' or 'N'.

Some numeric types specify unitless numbers, while others specify values with units, such as the amount of memory or time. The default units, whether memory or time, depend on the type of parameter: if you specify just a number without units, the units defined in pg_settings.unit will be used, but you can specify different units by attaching units such as B, kB, MB, GB for memory, and ms, s, min, h, d for time, after the number.

Parameters that specify integer values can be specified in decimal notation, as well as hexadecimal notation starting with 0x, and octal notation starting with 0.

Values for parameters that specify strings are enclosed in single quotes, and two single quotes must be placed in sequence if the value contains single quotes. This is the same as how strings are specified in SQL.

So the correct answers are A, D, and E.

For details about how to specify the configuration file, see