escapePostgresConfLiteral escapes an arbitrary string so it can be used as a value in a PostgreSQL configuration file, wrapped in single quotes. pq.QuoteLiteral is unsuitable here: it emits ` E'...'` when the value contains a backslash, and the PostgreSQL config parser does not recognise the `E'...
(value string)
| 48 | // contains a backslash, and the PostgreSQL config parser does not recognise |
| 49 | // the `E'...'` syntax. |
| 50 | func escapePostgresConfLiteral(value string) string { |
| 51 | return "'" + postgresConfLiteralReplacer.Replace(value) + "'" |
| 52 | } |
| 53 | |
| 54 | // UpdatePostgresConfigurationFile search and replace options in a Postgres configuration file. |
| 55 | // If any managedOptions is passed, it will be removed unless present in the options map. |
no outgoing calls
no test coverage detected