summaryrefslogtreecommitdiff
path: root/src/bin/initdb
diff options
context:
space:
mode:
authorTom Lane2017-06-21 19:35:54 +0000
committerTom Lane2017-06-21 19:35:54 +0000
commit382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch)
treef558251492f2c6f86e3566f7a82f9d00509122c2 /src/bin/initdb
parentc7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff)
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/bin/initdb')
-rw-r--r--src/bin/initdb/findtimezone.c2
-rw-r--r--src/bin/initdb/initdb.c46
2 files changed, 24 insertions, 24 deletions
diff --git a/src/bin/initdb/findtimezone.c b/src/bin/initdb/findtimezone.c
index 96aa39021e8..c9b4141a16f 100644
--- a/src/bin/initdb/findtimezone.c
+++ b/src/bin/initdb/findtimezone.c
@@ -1221,7 +1221,7 @@ identify_system_timezone(void)
*/
memset(localtzname, 0, sizeof(localtzname));
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
+ "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
0,
KEY_READ,
&rootKey) != ERROR_SUCCESS)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 7fdaca868a1..0f22e6d29a4 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -584,12 +584,12 @@ exit_nicely(void)
{
if (made_new_pgdata || found_existing_pgdata)
fprintf(stderr,
- _("%s: data directory \"%s\" not removed at user's request\n"),
+ _("%s: data directory \"%s\" not removed at user's request\n"),
progname, pg_data);
if (made_new_xlogdir || found_existing_xlogdir)
fprintf(stderr,
- _("%s: WAL directory \"%s\" not removed at user's request\n"),
+ _("%s: WAL directory \"%s\" not removed at user's request\n"),
progname, xlog_dir);
}
@@ -769,16 +769,16 @@ check_input(char *path)
_("%s: file \"%s\" does not exist\n"), progname, path);
fprintf(stderr,
_("This might mean you have a corrupted installation or identified\n"
- "the wrong directory with the invocation option -L.\n"));
+ "the wrong directory with the invocation option -L.\n"));
}
else
{
fprintf(stderr,
- _("%s: could not access file \"%s\": %s\n"), progname, path,
+ _("%s: could not access file \"%s\": %s\n"), progname, path,
strerror(errno));
fprintf(stderr,
_("This might mean you have a corrupted installation or identified\n"
- "the wrong directory with the invocation option -L.\n"));
+ "the wrong directory with the invocation option -L.\n"));
}
exit(1);
}
@@ -787,8 +787,8 @@ check_input(char *path)
fprintf(stderr,
_("%s: file \"%s\" is not a regular file\n"), progname, path);
fprintf(stderr,
- _("This might mean you have a corrupted installation or identified\n"
- "the wrong directory with the invocation option -L.\n"));
+ _("This might mean you have a corrupted installation or identified\n"
+ "the wrong directory with the invocation option -L.\n"));
exit(1);
}
}
@@ -1078,7 +1078,7 @@ setup_config(void)
"default_text_search_config = 'pg_catalog.%s'",
escape_quotes(default_text_search_config));
conflines = replace_token(conflines,
- "#default_text_search_config = 'pg_catalog.simple'",
+ "#default_text_search_config = 'pg_catalog.simple'",
repltok);
default_timezone = select_default_timezone(share_path);
@@ -1216,11 +1216,11 @@ setup_config(void)
getaddrinfo("::1", NULL, &hints, &gai_result) != 0)
{
conflines = replace_token(conflines,
- "host all all ::1",
- "#host all all ::1");
+ "host all all ::1",
+ "#host all all ::1");
conflines = replace_token(conflines,
- "host replication all ::1",
- "#host replication all ::1");
+ "host replication all ::1",
+ "#host replication all ::1");
}
}
#else /* !HAVE_IPV6 */
@@ -1603,7 +1603,7 @@ setup_description(FILE *cmdfd)
/* Create default descriptions for operator implementation functions */
PG_CMD_PUTS("WITH funcdescs AS ( "
"SELECT p.oid as p_oid, oprname, "
- "coalesce(obj_description(o.oid, 'pg_operator'),'') as opdesc "
+ "coalesce(obj_description(o.oid, 'pg_operator'),'') as opdesc "
"FROM pg_proc p JOIN pg_operator o ON oprcode = p.oid ) "
"INSERT INTO pg_description "
" SELECT p_oid, 'pg_proc'::regclass, 0, "
@@ -1611,7 +1611,7 @@ setup_description(FILE *cmdfd)
" FROM funcdescs "
" WHERE opdesc NOT LIKE 'deprecated%' AND "
" NOT EXISTS (SELECT 1 FROM pg_description "
- " WHERE objoid = p_oid AND classoid = 'pg_proc'::regclass);\n\n");
+ " WHERE objoid = p_oid AND classoid = 'pg_proc'::regclass);\n\n");
/*
* Even though the tables are temp, drop them explicitly so they don't get
@@ -2184,9 +2184,9 @@ check_locale_encoding(const char *locale, int user_enc)
fprintf(stderr, _("%s: encoding mismatch\n"), progname);
fprintf(stderr,
_("The encoding you selected (%s) and the encoding that the\n"
- "selected locale uses (%s) do not match. This would lead to\n"
- "misbehavior in various character string processing functions.\n"
- "Rerun %s and either do not specify an encoding explicitly,\n"
+ "selected locale uses (%s) do not match. This would lead to\n"
+ "misbehavior in various character string processing functions.\n"
+ "Rerun %s and either do not specify an encoding explicitly,\n"
"or choose a matching combination.\n"),
pg_encoding_to_char(user_enc),
pg_encoding_to_char(locale_enc),
@@ -2272,7 +2272,7 @@ usage(const char *progname)
printf(_(" --no-locale equivalent to --locale=C\n"));
printf(_(" --pwfile=FILE read password for the new superuser from file\n"));
printf(_(" -T, --text-search-config=CFG\n"
- " default text search configuration\n"));
+ " default text search configuration\n"));
printf(_(" -U, --username=NAME database superuser name\n"));
printf(_(" -W, --pwprompt prompt for a password for the new superuser\n"));
printf(_(" -X, --waldir=WALDIR location for the write-ahead log directory\n"));
@@ -2299,7 +2299,7 @@ check_authmethod_unspecified(const char **authmethod)
{
authwarning = _("\nWARNING: enabling \"trust\" authentication for local connections\n"
"You can change this by editing pg_hba.conf or using the option -A, or\n"
- "--auth-local and --auth-host, the next time you run initdb.\n");
+ "--auth-local and --auth-host, the next time you run initdb.\n");
*authmethod = "trust";
}
}
@@ -2489,18 +2489,18 @@ setup_locale_encoding(void)
*/
#ifdef WIN32
printf(_("Encoding \"%s\" implied by locale is not allowed as a server-side encoding.\n"
- "The default database encoding will be set to \"%s\" instead.\n"),
+ "The default database encoding will be set to \"%s\" instead.\n"),
pg_encoding_to_char(ctype_enc),
pg_encoding_to_char(PG_UTF8));
ctype_enc = PG_UTF8;
encodingid = encodingid_to_string(ctype_enc);
#else
fprintf(stderr,
- _("%s: locale \"%s\" requires unsupported encoding \"%s\"\n"),
+ _("%s: locale \"%s\" requires unsupported encoding \"%s\"\n"),
progname, lc_ctype, pg_encoding_to_char(ctype_enc));
fprintf(stderr,
- _("Encoding \"%s\" is not allowed as a server-side encoding.\n"
- "Rerun %s with a different locale selection.\n"),
+ _("Encoding \"%s\" is not allowed as a server-side encoding.\n"
+ "Rerun %s with a different locale selection.\n"),
pg_encoding_to_char(ctype_enc), progname);
exit(1);
#endif