Records cannot be continued across lines.
A record is made
up of a number of fields which are separated by spaces and/or tabs.
- Fields can contain white space if the field value is quoted.
+ Fields can contain white space if the field value is double-quoted.
Quoting one of the keywords in a database, user, or address field (e.g.,
<literal>all</> or <literal>replication</>) makes the word lose its special
character, and just match a database, user, or host with that name.
bki_lines = replace_token(bki_lines, "FLOAT8PASSBYVAL",
FLOAT8PASSBYVAL ? "true" : "false");
- bki_lines = replace_token(bki_lines, "POSTGRES", username);
+ bki_lines = replace_token(bki_lines, "POSTGRES", escape_quotes(username));
bki_lines = replace_token(bki_lines, "ENCODING", encodingid);
PG_CMD_OPEN;
- priv_lines = replace_token(privileges_setup,
- "$POSTGRES_SUPERUSERNAME", username);
+ priv_lines = replace_token(privileges_setup, "$POSTGRES_SUPERUSERNAME",
+ escape_quotes(username));
for (line = priv_lines; *line != NULL; line++)
PG_CMD_PUTS(*line);
canonicalize_path(pg_data);
#ifdef WIN32
-
/*
* Before we execute another program, make sure that we are running with a
* restricted token. If not, re-execute ourselves with one.