Postgresql - Augeas Documentation

# Postgresql

Parses postgresql.conf

Author: Raphael Pinson rap.nosp@m.hink@gmai.nosp@m.l.com

Summary

Postgresql | Parses postgresql.conf
Reference | http://www.postgresql.org/docs/current/static/config-setting.html
License | This file is licenced under the LGPL v2+, like the rest of Augeas.
Lens Usage | To be documented
Configuration files | This lens applies to postgresql.conf.
Examples | The Test_Postgresql file contains various examples and tests.
Augeas Lenses |
sep | Key and values are separated by either spaces or an equal sign
Augeas Variables |
word_opt_quot_re | Strings that don’t require quotes
Augeas Lenses |
word_opt_quot | Storing a word_opt_quot_re, with or without quotes
Augeas Variables |
number_re | A relative decimal number, optionally with unit
Augeas Lenses |
number | Storing number_re, with or without quotes
word_quot | Anything other than word_opt_quot or number Quotes are mandatory
entry_gen | Builder to construct entries
entry |
lns |
Augeas Variables |
filter |

### Reference

http://www.postgresql.org/docs/current/static/config-setting.html

### License

This file is licenced under the LGPL v2+, like the rest of Augeas.

### Lens Usage

To be documented

### Configuration files

This lens applies to postgresql.conf. See filter.

### Examples

The Test_Postgresql file contains various examples and tests.

### Augeas Lenses

### sep

> let sep = del /([ \t]+)|([ \t]*=[ \t]*)/ " = "

Key and values are separated by either spaces or an equal sign

### Augeas Variables

### word_opt_quot_re

> let word_opt_quot_re = /[A-Za-z][A-Za-z0-9_-]*/

Strings that don’t require quotes

### Augeas Lenses

### word_opt_quot

> let word_opt_quot = Quote.do_squote_opt (store word_opt_quot_re)

Storing a word_opt_quot_re, with or without quotes

### Augeas Variables

### number_re

> let number_re = Rx.reldecimal . /[kMG]?B|[m]?s|min|h|d/?

A relative decimal number, optionally with unit

### Augeas Lenses

### number

> let number = Quote.do_squote_opt (store number_re)

Storing number_re, with or without quotes

### word_quot

> let word_quot = let esc_squot = /\\\\'/ in let no_quot = /[^#'\n]/ in let forbidden = word_opt_quot_re | number_re in let value = (no_quot|esc_squot)* - forbidden in Quote.do_squote (store value)

Anything other than word_opt_quot or number Quotes are mandatory

### entry_gen

> let entry_gen (lns:lens) = Util.indent . Build.key_value_line_comment Rx.word sep lns Util.comment_eol

Builder to construct entries

### entry

> let entry = entry_gen number | entry_gen word_opt_quot | entry_gen word_quot (* anything else *)

### lns

> let lns = (Util.empty | Util.comment | entry)*

### Augeas Variables

### filter

Provides unit tests and examples for the Postgresql lens.

> let sep = del /([ \t]+)|([ \t]*=[ \t]*)/ " = "

Key and values are separated by either spaces or an equal sign

> let word_opt_quot_re = /[A-Za-z][A-Za-z0-9_-]*/

Strings that don’t require quotes

> let word_opt_quot = Quote.do_squote_opt (store word_opt_quot_re)

Storing a word_opt_quot_re, with or without quotes

> let number_re = Rx.reldecimal . /[kMG]?B|[m]?s|min|h|d/?

A relative decimal number, optionally with unit

> let number = Quote.do_squote_opt (store number_re)

Storing number_re, with or without quotes

> let word_quot = let esc_squot = /\\\\'/ in let no_quot = /[^#'\n]/ in let forbidden = word_opt_quot_re | number_re in let value = (no_quot|esc_squot)* - forbidden in Quote.do_squote (store value)

Anything other than word_opt_quot or number Quotes are mandatory

> let entry_gen (lns:lens) = Util.indent . Build.key_value_line_comment Rx.word sep lns Util.comment_eol

Builder to construct entries

> let entry = entry_gen number | entry_gen word_opt_quot | entry_gen word_quot (* anything else *)

> let lns = (Util.empty | Util.comment | entry)*

Close