diff options
| author | Bruce Momjian | 2011-06-09 18:32:50 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2011-06-09 18:32:50 +0000 |
| commit | 6560407c7db2c7e32926a46f5fb52175ac10d9e5 (patch) | |
| tree | 9641e538893819410634624a8e0cb86a13d857a6 /src/bin | |
| parent | adf43b2b36ca3d7f988933990051c74a4bd0d6f8 (diff) | |
Pgindent run before 9.1 beta2.
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/initdb/initdb.c | 42 | ||||
| -rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 4 | ||||
| -rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 26 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_backup.h | 2 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_dump.c | 27 | ||||
| -rw-r--r-- | src/bin/psql/describe.c | 6 | ||||
| -rw-r--r-- | src/bin/scripts/createdb.c | 10 | ||||
| -rw-r--r-- | src/bin/scripts/dropdb.c | 9 |
8 files changed, 63 insertions, 63 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 4949af9657..399c734bc9 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -1086,7 +1086,7 @@ setup_config(void) "@authcomment@", strcmp(authmethod, "trust") ? "" : AUTHTRUST_WARNING); - /* Replace username for replication */ + /* Replace username for replication */ conflines = replace_token(conflines, "@default_username@", username); @@ -1663,7 +1663,7 @@ setup_collation(void) */ if (normalize_locale_name(alias, localebuf)) PG_CMD_PRINTF3("INSERT INTO tmp_pg_collation VALUES (E'%s', E'%s', %d);\n", - escape_quotes(alias), quoted_locale, enc); + escape_quotes(alias), quoted_locale, enc); } /* Add an SQL-standard name */ @@ -1688,7 +1688,7 @@ setup_collation(void) " encoding, locale, locale " " FROM tmp_pg_collation" " WHERE NOT EXISTS (SELECT 1 FROM pg_collation WHERE collname = tmp_pg_collation.collname)" - " ORDER BY collname, encoding, (collname = locale) DESC, locale;\n"); + " ORDER BY collname, encoding, (collname = locale) DESC, locale;\n"); pclose(locale_a_handle); PG_CMD_CLOSE; @@ -1702,7 +1702,7 @@ setup_collation(void) #else /* not HAVE_LOCALE_T && not WIN32 */ printf(_("not supported on this platform\n")); fflush(stdout); -#endif /* not HAVE_LOCALE_T && not WIN32*/ +#endif /* not HAVE_LOCALE_T && not WIN32 */ } /* @@ -2272,20 +2272,19 @@ check_locale_encoding(const char *locale, int user_enc) static void strreplace(char *str, char *needle, char *replacement) { - char *s; + char *s; s = strstr(str, needle); if (s != NULL) { - int replacementlen = strlen(replacement); - char *rest = s + strlen(needle); + int replacementlen = strlen(replacement); + char *rest = s + strlen(needle); memcpy(s, replacement, replacementlen); memmove(s + replacementlen, rest, strlen(rest) + 1); } } - -#endif /* WIN32 */ +#endif /* WIN32 */ /* * Windows has a problem with locale names that have a dot in the country @@ -2306,6 +2305,7 @@ localemap(char *locale) locale = xstrdup(locale); #ifdef WIN32 + /* * Map the full country name to an abbreviation that setlocale() accepts. * @@ -2321,14 +2321,14 @@ localemap(char *locale) /* * The ISO-3166 country code for Macau S.A.R. is MAC, but Windows doesn't - * seem to recognize that. And Macau isn't listed in the table of - * accepted abbreviations linked above. + * seem to recognize that. And Macau isn't listed in the table of accepted + * abbreviations linked above. * - * Fortunately, "ZHM" seems to be accepted as an alias for - * "Chinese (Traditional)_Macau S.A.R..950", so we use that. Note that - * it's unlike HKG and ARE, ZHM is an alias for the whole locale name, - * not just the country part. I'm not sure where that "ZHM" comes from, - * must be some legacy naming scheme. But hey, it works. + * Fortunately, "ZHM" seems to be accepted as an alias for "Chinese + * (Traditional)_Macau S.A.R..950", so we use that. Note that it's unlike + * HKG and ARE, ZHM is an alias for the whole locale name, not just the + * country part. I'm not sure where that "ZHM" comes from, must be some + * legacy naming scheme. But hey, it works. * * Some versions of Windows spell it "Macau", others "Macao". */ @@ -2336,7 +2336,7 @@ localemap(char *locale) strreplace(locale, "Chinese_Macau S.A.R..950", "ZHM"); strreplace(locale, "Chinese (Traditional)_Macao S.A.R..950", "ZHM"); strreplace(locale, "Chinese_Macao S.A.R..950", "ZHM"); -#endif /* WIN32 */ +#endif /* WIN32 */ return locale; } @@ -3000,13 +3000,13 @@ main(int argc, char *argv[]) else if (!pg_valid_server_encoding_id(ctype_enc)) { /* - * We recognized it, but it's not a legal server encoding. - * On Windows, UTF-8 works with any locale, so we can fall back - * to UTF-8. + * We recognized it, but it's not a legal server encoding. On + * Windows, UTF-8 works with any locale, so we can fall back to + * UTF-8. */ #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; diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 17cff8dd5b..9bf1fcdc4b 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -130,7 +130,7 @@ usage(void) printf(_(" -Z, --compress=0-9 compress tar output with given compression level\n")); printf(_("\nGeneral options:\n")); printf(_(" -c, --checkpoint=fast|spread\n" - " set fast or spread checkpointing\n")); + " set fast or spread checkpointing\n")); printf(_(" -l, --label=LABEL set backup label\n")); printf(_(" -P, --progress show progress information\n")); printf(_(" -v, --verbose output verbose messages\n")); @@ -1006,7 +1006,7 @@ main(int argc, char **argv) #ifdef HAVE_LIBZ compresslevel = Z_DEFAULT_COMPRESSION; #else - compresslevel = 1; /* will be rejected below */ + compresslevel = 1; /* will be rejected below */ #endif break; case 'Z': diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 8172d076cf..a3933abaa6 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -370,9 +370,9 @@ start_postmaster(void) * Since there might be quotes to handle here, it is easier simply to pass * everything to a shell to process them. * - * XXX it would be better to fork and exec so that we would know the - * child postmaster's PID directly; then test_postmaster_connection could - * use the PID without having to rely on reading it back from the pidfile. + * XXX it would be better to fork and exec so that we would know the child + * postmaster's PID directly; then test_postmaster_connection could use + * the PID without having to rely on reading it back from the pidfile. */ if (log_file != NULL) snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1 &" SYSTEMQUOTE, @@ -479,7 +479,7 @@ test_postmaster_connection(bool do_checkpoint) time_t pmstart; /* - * Make sanity checks. If it's for a standalone backend + * Make sanity checks. If it's for a standalone backend * (negative PID), or the recorded start time is before * pg_ctl started, then either we are looking at the wrong * data directory, or this is a pre-existing pidfile that @@ -492,8 +492,8 @@ test_postmaster_connection(bool do_checkpoint) if (pmpid <= 0 || pmstart < start_time - 2) { /* - * Set flag to report stale pidfile if it doesn't - * get overwritten before we give up waiting. + * Set flag to report stale pidfile if it doesn't get + * overwritten before we give up waiting. */ found_stale_pidfile = true; } @@ -552,7 +552,7 @@ test_postmaster_connection(bool do_checkpoint) * timeout first. */ snprintf(connstr, sizeof(connstr), - "dbname=postgres port=%d host='%s' connect_timeout=5", + "dbname=postgres port=%d host='%s' connect_timeout=5", portnum, host_str); } } @@ -570,11 +570,11 @@ test_postmaster_connection(bool do_checkpoint) /* * The postmaster should create postmaster.pid very soon after being * started. If it's not there after we've waited 5 or more seconds, - * assume startup failed and give up waiting. (Note this covers - * both cases where the pidfile was never created, and where it was - * created and then removed during postmaster exit.) Also, if there - * *is* a file there but it appears stale, issue a suitable warning - * and give up waiting. + * assume startup failed and give up waiting. (Note this covers both + * cases where the pidfile was never created, and where it was created + * and then removed during postmaster exit.) Also, if there *is* a + * file there but it appears stale, issue a suitable warning and give + * up waiting. */ if (i >= 5) { @@ -593,7 +593,7 @@ test_postmaster_connection(bool do_checkpoint) /* * If we've been able to identify the child postmaster's PID, check - * the process is still alive. This covers cases where the postmaster + * the process is still alive. This covers cases where the postmaster * successfully created the pidfile but then crashed without removing * it. */ diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h index 28175674c0..ce12a41ce3 100644 --- a/src/bin/pg_dump/pg_backup.h +++ b/src/bin/pg_dump/pg_backup.h @@ -104,7 +104,7 @@ typedef struct _restoreOptions * restore */ int use_setsessauth;/* Use SET SESSION AUTHORIZATION commands * instead of OWNER TO */ - int no_security_labels; /* Skip security label entries */ + int no_security_labels; /* Skip security label entries */ char *superuser; /* Username to use as superuser */ char *use_role; /* Issue SET ROLE to this */ int dataOnly; diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 3781e599c4..9e69b0fc52 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -7968,14 +7968,14 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo) * collation does not matter for those. */ appendPQExpBuffer(query, "SELECT a.attname, " - "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, " + "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, " "a.attlen, a.attalign, a.attisdropped, " "CASE WHEN a.attcollation <> at.typcollation " "THEN a.attcollation ELSE 0 END AS attcollation, " "ct.typrelid " "FROM pg_catalog.pg_type ct " - "JOIN pg_catalog.pg_attribute a ON a.attrelid = ct.typrelid " - "LEFT JOIN pg_catalog.pg_type at ON at.oid = a.atttypid " + "JOIN pg_catalog.pg_attribute a ON a.attrelid = ct.typrelid " + "LEFT JOIN pg_catalog.pg_type at ON at.oid = a.atttypid " "WHERE ct.oid = '%u'::pg_catalog.oid " "ORDER BY a.attnum ", tyinfo->dobj.catId.oid); @@ -7988,11 +7988,11 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo) * always be false. */ appendPQExpBuffer(query, "SELECT a.attname, " - "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, " + "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, " "a.attlen, a.attalign, a.attisdropped, " "0 AS attcollation, " "ct.typrelid " - "FROM pg_catalog.pg_type ct, pg_catalog.pg_attribute a " + "FROM pg_catalog.pg_type ct, pg_catalog.pg_attribute a " "WHERE ct.oid = '%u'::pg_catalog.oid " "AND a.attrelid = ct.typrelid " "ORDER BY a.attnum ", @@ -8072,15 +8072,15 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo) { /* * This is a dropped attribute and we're in binary_upgrade mode. - * Insert a placeholder for it in the CREATE TYPE command, and - * set length and alignment with direct UPDATE to the catalogs + * Insert a placeholder for it in the CREATE TYPE command, and set + * length and alignment with direct UPDATE to the catalogs * afterwards. See similar code in dumpTableSchema(). */ appendPQExpBuffer(q, "%s INTEGER /* dummy */", fmtId(attname)); /* stash separately for insertion after the CREATE TYPE */ appendPQExpBuffer(dropped, - "\n-- For binary upgrade, recreate dropped column.\n"); + "\n-- For binary upgrade, recreate dropped column.\n"); appendPQExpBuffer(dropped, "UPDATE pg_catalog.pg_attribute\n" "SET attlen = %s, " "attalign = '%s', attbyval = false\n" @@ -8380,8 +8380,8 @@ dumpProcLang(Archive *fout, ProcLangInfo *plang) * However, for a language that belongs to an extension, we must not use * the shouldDumpProcLangs heuristic, but just dump the language iff we're * told to (via dobj.dump). Generally the support functions will belong - * to the same extension and so have the same dump flags ... if they don't, - * this might not work terribly nicely. + * to the same extension and so have the same dump flags ... if they + * don't, this might not work terribly nicely. */ useParams = (funcInfo != NULL && (inlineInfo != NULL || !OidIsValid(plang->laninline)) && @@ -11181,8 +11181,8 @@ dumpForeignDataWrapper(Archive *fout, FdwInfo *fdwinfo) return; /* - * FDWs that belong to an extension are dumped based on their "dump" field. - * Otherwise omit them if we are only dumping some specific object. + * FDWs that belong to an extension are dumped based on their "dump" + * field. Otherwise omit them if we are only dumping some specific object. */ if (!fdwinfo->dobj.ext_member) if (!include_everything) @@ -11963,7 +11963,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) if (binary_upgrade) binary_upgrade_set_type_oids_by_rel_oid(q, - tbinfo->dobj.catId.oid); + tbinfo->dobj.catId.oid); /* Is it a table or a view? */ if (tbinfo->relkind == RELKIND_VIEW) @@ -12085,6 +12085,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) "UNLOGGED " : "", reltypename, fmtId(tbinfo->dobj.name)); + /* * In case of a binary upgrade, we dump the table normally and attach * it to the type afterward. diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 6f603d4512..b2c54b5f92 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -1746,7 +1746,7 @@ describeOneTableDetails(const char *schemaname, { printfPQExpBuffer(&buf, "SELECT conname,\n" - " pg_catalog.pg_get_constraintdef(r.oid, true) as condef\n" + " pg_catalog.pg_get_constraintdef(r.oid, true) as condef\n" "FROM pg_catalog.pg_constraint r\n" "WHERE r.conrelid = '%s' AND r.contype = 'f' ORDER BY 1", oid); @@ -2693,7 +2693,7 @@ listDomains(const char *pattern, bool showSystem) printfPQExpBuffer(&buf, "SELECT n.nspname as \"%s\",\n" " t.typname as \"%s\",\n" - " pg_catalog.format_type(t.typbasetype, t.typtypmod) as \"%s\",\n" + " pg_catalog.format_type(t.typbasetype, t.typtypmod) as \"%s\",\n" " TRIM(LEADING\n", gettext_noop("Schema"), gettext_noop("Name"), @@ -2703,7 +2703,7 @@ listDomains(const char *pattern, bool showSystem) " COALESCE((SELECT ' collate ' || c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type bt\n" " WHERE c.oid = t.typcollation AND bt.oid = t.typbasetype AND t.typcollation <> bt.typcollation), '') ||\n"); appendPQExpBuffer(&buf, - " CASE WHEN t.typnotnull THEN ' not null' ELSE '' END ||\n" + " CASE WHEN t.typnotnull THEN ' not null' ELSE '' END ||\n" " CASE WHEN t.typdefault IS NOT NULL THEN ' default ' || t.typdefault ELSE '' END\n" " ) as \"%s\",\n", gettext_noop("Modifier")); diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c index 544f2f64b3..d7c3928eb6 100644 --- a/src/bin/scripts/createdb.c +++ b/src/bin/scripts/createdb.c @@ -192,11 +192,11 @@ main(int argc, char *argv[]) appendPQExpBuffer(&sql, ";\n"); - /* - * Connect to the 'postgres' database by default, except have - * the 'postgres' user use 'template1' so he can create the - * 'postgres' database. - */ + /* + * Connect to the 'postgres' database by default, except have the + * 'postgres' user use 'template1' so he can create the 'postgres' + * database. + */ conn = connectDatabase(strcmp(dbname, "postgres") == 0 ? "template1" : "postgres", host, port, username, prompt_password, progname); diff --git a/src/bin/scripts/dropdb.c b/src/bin/scripts/dropdb.c index 48f73ae25e..4cec63ec8e 100644 --- a/src/bin/scripts/dropdb.c +++ b/src/bin/scripts/dropdb.c @@ -113,11 +113,10 @@ main(int argc, char *argv[]) appendPQExpBuffer(&sql, "DROP DATABASE %s;\n", fmtId(dbname)); - /* - * Connect to the 'postgres' database by default, except have - * the 'postgres' user use 'template1' so he can drop the - * 'postgres' database. - */ + /* + * Connect to the 'postgres' database by default, except have the + * 'postgres' user use 'template1' so he can drop the 'postgres' database. + */ conn = connectDatabase(strcmp(dbname, "postgres") == 0 ? "template1" : "postgres", host, port, username, prompt_password, progname); |
