aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2010-10-19 22:37:04 +0000
committerBruce Momjian <bruce@momjian.us>2010-10-19 22:37:04 +0000
commit07456b45e6359e8a15807e3f71c0f2e6a76fa4e9 (patch)
treeb4694ef2be2c1b0284ec00771fda6d9ab5ddd96d
parente13f7e9a711c9117e438516537066bbe61df6455 (diff)
downloadpostgresql-07456b45e6359e8a15807e3f71c0f2e6a76fa4e9.tar.gz
postgresql-07456b45e6359e8a15807e3f71c0f2e6a76fa4e9.zip
Pgindent run on pg_upgrade source after restructuring.
-rw-r--r--contrib/pg_upgrade/check.c28
-rw-r--r--contrib/pg_upgrade/controldata.c11
-rw-r--r--contrib/pg_upgrade/dump.c2
-rw-r--r--contrib/pg_upgrade/exec.c8
-rw-r--r--contrib/pg_upgrade/file.c6
-rw-r--r--contrib/pg_upgrade/function.c2
-rw-r--r--contrib/pg_upgrade/info.c4
-rw-r--r--contrib/pg_upgrade/option.c2
-rw-r--r--contrib/pg_upgrade/pg_upgrade.c15
-rw-r--r--contrib/pg_upgrade/pg_upgrade.h29
-rw-r--r--contrib/pg_upgrade/relfilenode.c14
-rw-r--r--contrib/pg_upgrade/server.c8
-rw-r--r--contrib/pg_upgrade/tablespace.c8
-rw-r--r--contrib/pg_upgrade/version_old_8_3.c18
14 files changed, 79 insertions, 76 deletions
diff --git a/contrib/pg_upgrade/check.c b/contrib/pg_upgrade/check.c
index e085e7681a2..3bae3d5aa08 100644
--- a/contrib/pg_upgrade/check.c
+++ b/contrib/pg_upgrade/check.c
@@ -15,7 +15,7 @@ static void check_new_db_is_empty(void);
static void check_locale_and_encoding(ControlData *oldctrl,
ControlData *newctrl);
static void check_for_isn_and_int8_passing_mismatch(
- Cluster whichCluster);
+ Cluster whichCluster);
static void check_for_reg_data_type_usage(Cluster whichCluster);
@@ -156,9 +156,9 @@ issue_warnings(char *sequence_script_file_name)
{
prep_status("Adjusting sequences");
exec_prog(true,
- SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
- "--no-psqlrc --port %d --username \"%s\" "
- "-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
+ SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
+ "--no-psqlrc --port %d --username \"%s\" "
+ "-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
new_cluster.bindir, new_cluster.port, os_info.user,
sequence_script_file_name, log.filename);
unlink(sequence_script_file_name);
@@ -418,12 +418,12 @@ create_script_for_old_cluster_deletion(
/* remove PG_VERSION? */
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 804)
fprintf(script, RM_CMD " %s%s/PG_VERSION\n",
- os_info.tablespaces[tblnum], old_cluster.tablespace_suffix);
+ os_info.tablespaces[tblnum], old_cluster.tablespace_suffix);
for (dbnum = 0; dbnum < new_cluster.dbarr.ndbs; dbnum++)
{
fprintf(script, RMDIR_CMD " %s%s/%d\n",
- os_info.tablespaces[tblnum], old_cluster.tablespace_suffix,
+ os_info.tablespaces[tblnum], old_cluster.tablespace_suffix,
old_cluster.dbarr.dbs[dbnum].db_oid);
}
}
@@ -434,7 +434,7 @@ create_script_for_old_cluster_deletion(
* or a version-specific subdirectory.
*/
fprintf(script, RMDIR_CMD " %s%s\n",
- os_info.tablespaces[tblnum], old_cluster.tablespace_suffix);
+ os_info.tablespaces[tblnum], old_cluster.tablespace_suffix);
}
fclose(script);
@@ -450,7 +450,7 @@ create_script_for_old_cluster_deletion(
/*
- * check_for_isn_and_int8_passing_mismatch()
+ * check_for_isn_and_int8_passing_mismatch()
*
* /contrib/isn relies on data type int8, and in 8.4 int8 can now be passed
* by value. The schema dumps the CREATE TYPE PASSEDBYVALUE setting so
@@ -547,7 +547,7 @@ check_for_isn_and_int8_passing_mismatch(Cluster whichCluster)
* pg_type.oid
* pg_enum.oid
*
- * Most of the reg* data types reference system catalog info that is
+ * Most of the reg* data types reference system catalog info that is
* not preserved, and hence these data types cannot be used in user
* tables upgraded by pg_upgrade.
*/
@@ -585,13 +585,13 @@ check_for_reg_data_type_usage(Cluster whichCluster)
"WHERE c.oid = a.attrelid AND "
" NOT a.attisdropped AND "
" a.atttypid IN ( "
- " 'pg_catalog.regproc'::pg_catalog.regtype, "
+ " 'pg_catalog.regproc'::pg_catalog.regtype, "
" 'pg_catalog.regprocedure'::pg_catalog.regtype, "
- " 'pg_catalog.regoper'::pg_catalog.regtype, "
+ " 'pg_catalog.regoper'::pg_catalog.regtype, "
" 'pg_catalog.regoperator'::pg_catalog.regtype, "
- " 'pg_catalog.regclass'::pg_catalog.regtype, "
- /* regtype.oid is preserved, so 'regtype' is OK */
- " 'pg_catalog.regconfig'::pg_catalog.regtype, "
+ " 'pg_catalog.regclass'::pg_catalog.regtype, "
+ /* regtype.oid is preserved, so 'regtype' is OK */
+ " 'pg_catalog.regconfig'::pg_catalog.regtype, "
" 'pg_catalog.regdictionary'::pg_catalog.regtype) AND "
" c.relnamespace = n.oid AND "
" n.nspname != 'pg_catalog' AND "
diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c
index 9facf214cae..3dc9e64b622 100644
--- a/contrib/pg_upgrade/controldata.c
+++ b/contrib/pg_upgrade/controldata.c
@@ -94,7 +94,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
#ifndef WIN32
NULL);
#else
- /* On Windows the default locale cannot be English, so force it */
+ /* On Windows the default locale cannot be English, so force it */
"en");
#endif
putenv2("LANGUAGE", NULL);
@@ -372,7 +372,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
pclose(output);
/*
- * Restore environment variables
+ * Restore environment variables
*/
putenv2("LC_COLLATE", lc_collate);
putenv2("LC_CTYPE", lc_ctype);
@@ -393,7 +393,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
pg_free(language);
pg_free(lc_all);
pg_free(lc_messages);
-
+
/* verify that we got all the mandatory pg_control data */
if (!got_xid || !got_oid ||
(!live_check && !got_log_id) ||
@@ -549,9 +549,10 @@ putenv2(const char *var, const char *val)
sprintf(envstr, "%s=%s", var, val);
putenv(envstr);
+
/*
- * Do not free envstr because it becomes part of the environment
- * on some operating systems. See port/unsetenv.c::unsetenv.
+ * Do not free envstr because it becomes part of the environment on
+ * some operating systems. See port/unsetenv.c::unsetenv.
*/
#else
SetEnvironmentVariableA(var, val);
diff --git a/contrib/pg_upgrade/dump.c b/contrib/pg_upgrade/dump.c
index 95ceaabd5cf..b63fdb0a385 100644
--- a/contrib/pg_upgrade/dump.c
+++ b/contrib/pg_upgrade/dump.c
@@ -24,7 +24,7 @@ generate_old_dump(void)
exec_prog(true,
SYSTEMQUOTE "\"%s/pg_dumpall\" --port %d --username \"%s\" "
"--schema-only --binary-upgrade > \"%s/" ALL_DUMP_FILE "\""
- SYSTEMQUOTE, new_cluster.bindir, old_cluster.port, os_info.user, os_info.cwd);
+ SYSTEMQUOTE, new_cluster.bindir, old_cluster.port, os_info.user, os_info.cwd);
check_ok();
}
diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c
index 5b52d48f403..c0202adc23a 100644
--- a/contrib/pg_upgrade/exec.c
+++ b/contrib/pg_upgrade/exec.c
@@ -13,7 +13,7 @@
#include <grp.h>
-static void check_data_dir(const char *pg_data);
+static void check_data_dir(const char *pg_data);
static void check_bin_dir(ClusterInfo *cluster);
static int check_exec(const char *dir, const char *cmdName);
static const char *validate_exec(const char *path);
@@ -128,7 +128,7 @@ check_data_dir(const char *pg_data)
int subdirnum;
const char *requiredSubdirs[] = {"base", "global", "pg_clog",
"pg_multixact", "pg_subtrans", "pg_tblspc", "pg_twophase",
- "pg_xlog"};
+ "pg_xlog"};
for (subdirnum = 0;
subdirnum < sizeof(requiredSubdirs) / sizeof(requiredSubdirs[0]);
@@ -143,8 +143,8 @@ check_data_dir(const char *pg_data)
report_status(PG_FATAL, "check for %s failed: %s",
requiredSubdirs[subdirnum], getErrorText(errno));
else if (!S_ISDIR(statBuf.st_mode))
- report_status(PG_FATAL, "%s is not a directory",
- requiredSubdirs[subdirnum]);
+ report_status(PG_FATAL, "%s is not a directory",
+ requiredSubdirs[subdirnum]);
}
}
diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
index a88d7aa6908..1b25a212c0b 100644
--- a/contrib/pg_upgrade/file.c
+++ b/contrib/pg_upgrade/file.c
@@ -173,8 +173,8 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
if (nbytes < 0)
{
- int save_errno = errno;
-
+ int save_errno = errno;
+
if (buffer != NULL)
free(buffer);
@@ -196,7 +196,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
if (write(dest_fd, buffer, nbytes) != nbytes)
{
/* if write didn't set errno, assume problem is no disk space */
- int save_errno = errno ? errno : ENOSPC;
+ int save_errno = errno ? errno : ENOSPC;
if (buffer != NULL)
free(buffer);
diff --git a/contrib/pg_upgrade/function.c b/contrib/pg_upgrade/function.c
index 2b4b167eaab..31255d637dc 100644
--- a/contrib/pg_upgrade/function.c
+++ b/contrib/pg_upgrade/function.c
@@ -253,7 +253,7 @@ check_loadable_libraries(void)
fclose(script);
pg_log(PG_REPORT, "fatal\n");
pg_log(PG_FATAL,
- "| Your installation references loadable libraries that are missing\n"
+ "| Your installation references loadable libraries that are missing\n"
"| from the new installation. You can add these libraries to\n"
"| the new installation, or remove the functions using them\n"
"| from the old installation. A list of the problem libraries\n"
diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index c86de71d7dc..b4e414ec8d9 100644
--- a/contrib/pg_upgrade/info.c
+++ b/contrib/pg_upgrade/info.c
@@ -201,9 +201,9 @@ print_maps(FileNameMap *maps, int n, const char *dbName)
for (mapnum = 0; mapnum < n; mapnum++)
pg_log(PG_DEBUG, "%s.%s:%u ==> %s.%s:%u\n",
maps[mapnum].old_nspname, maps[mapnum].old_relname,
- maps[mapnum].old_relfilenode,
+ maps[mapnum].old_relfilenode,
maps[mapnum].new_nspname, maps[mapnum].new_relname,
- maps[mapnum].new_relfilenode);
+ maps[mapnum].new_relfilenode);
pg_log(PG_DEBUG, "\n\n");
}
diff --git a/contrib/pg_upgrade/option.c b/contrib/pg_upgrade/option.c
index 75f0db5ddde..1f4c55ac7a7 100644
--- a/contrib/pg_upgrade/option.c
+++ b/contrib/pg_upgrade/option.c
@@ -23,7 +23,7 @@ static void get_pkglibdirs(void);
static char *get_pkglibdir(const char *bindir);
-UserOpts user_opts;
+UserOpts user_opts;
/*
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
index 37defc51add..c140f6521e9 100644
--- a/contrib/pg_upgrade/pg_upgrade.c
+++ b/contrib/pg_upgrade/pg_upgrade.c
@@ -22,7 +22,8 @@ static void set_frozenxids(void);
static void setup(char *argv0, bool live_check);
static void cleanup(void);
-ClusterInfo old_cluster, new_cluster;
+ClusterInfo old_cluster,
+ new_cluster;
OSInfo os_info;
int
@@ -82,7 +83,7 @@ main(int argc, char **argv)
prep_status("Setting next oid for new cluster");
exec_prog(true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -o %u \"%s\" > "
DEVNULL SYSTEMQUOTE,
- new_cluster.bindir, old_cluster.controldata.chkpnt_nxtoid, new_cluster.pgdata);
+ new_cluster.bindir, old_cluster.controldata.chkpnt_nxtoid, new_cluster.pgdata);
check_ok();
create_script_for_old_cluster_deletion(&deletion_script_file_name);
@@ -161,7 +162,7 @@ prepare_new_cluster(void)
exec_prog(true,
SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" "
"--all --analyze >> %s 2>&1" SYSTEMQUOTE,
- new_cluster.bindir, new_cluster.port, os_info.user, log.filename);
+ new_cluster.bindir, new_cluster.port, os_info.user, log.filename);
check_ok();
/*
@@ -174,7 +175,7 @@ prepare_new_cluster(void)
exec_prog(true,
SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" "
"--all --freeze >> %s 2>&1" SYSTEMQUOTE,
- new_cluster.bindir, new_cluster.port, os_info.user, log.filename);
+ new_cluster.bindir, new_cluster.port, os_info.user, log.filename);
check_ok();
get_pg_database_relfilenode(CLUSTER_NEW);
@@ -202,7 +203,7 @@ prepare_new_databases(void)
prep_status("Creating databases in the new cluster");
exec_prog(true,
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
- /* --no-psqlrc prevents AUTOCOMMIT=off */
+ /* --no-psqlrc prevents AUTOCOMMIT=off */
"--no-psqlrc --port %d --username \"%s\" "
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
new_cluster.bindir, new_cluster.port, os_info.user, os_info.cwd,
@@ -273,14 +274,14 @@ copy_clog_xlog_xid(void)
/* set the next transaction id of the new cluster */
prep_status("Setting next transaction id for new cluster");
exec_prog(true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -f -x %u \"%s\" > " DEVNULL SYSTEMQUOTE,
- new_cluster.bindir, old_cluster.controldata.chkpnt_nxtxid, new_cluster.pgdata);
+ new_cluster.bindir, old_cluster.controldata.chkpnt_nxtxid, new_cluster.pgdata);
check_ok();
/* now reset the wal archives in the new cluster */
prep_status("Resetting WAL archives");
exec_prog(true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -l %u,%u,%u \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
new_cluster.bindir, old_cluster.controldata.chkpnt_tli,
- old_cluster.controldata.logid, old_cluster.controldata.nxtlogseg,
+ old_cluster.controldata.logid, old_cluster.controldata.nxtlogseg,
new_cluster.pgdata, log.filename);
check_ok();
}
diff --git a/contrib/pg_upgrade/pg_upgrade.h b/contrib/pg_upgrade/pg_upgrade.h
index 36f392c6ea5..3756f5cbb0a 100644
--- a/contrib/pg_upgrade/pg_upgrade.h
+++ b/contrib/pg_upgrade/pg_upgrade.h
@@ -53,7 +53,7 @@
#endif
#define CLUSTERNAME(cluster) ((cluster) == CLUSTER_OLD ? "old" : "new")
-#define ACTIVE_CLUSTER(cluster) (((cluster) == CLUSTER_OLD) ? \
+#define ACTIVE_CLUSTER(cluster) (((cluster) == CLUSTER_OLD) ? \
&old_cluster : &new_cluster)
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
@@ -85,8 +85,8 @@ typedef struct
*/
typedef struct
{
- Oid old_relfilenode; /* Relfilenode of the old relation */
- Oid new_relfilenode; /* Relfilenode of the new relation */
+ Oid old_relfilenode; /* Relfilenode of the old relation */
+ Oid new_relfilenode; /* Relfilenode of the new relation */
char old_file[MAXPGPATH];
char new_file[MAXPGPATH];
char old_nspname[NAMEDATALEN]; /* old name of the namespace */
@@ -240,10 +240,11 @@ typedef struct
/*
* Global variables
*/
-extern Log log;
-extern UserOpts user_opts;
-extern ClusterInfo old_cluster, new_cluster;
-extern OSInfo os_info;
+extern Log log;
+extern UserOpts user_opts;
+extern ClusterInfo old_cluster,
+ new_cluster;
+extern OSInfo os_info;
extern char scandir_file_pattern[];
@@ -260,7 +261,7 @@ void output_completion_banner(
char *deletion_script_file_name);
void check_cluster_versions(void);
void check_cluster_compatibility(bool live_check);
-void create_script_for_old_cluster_deletion(char **deletion_script_file_name);
+void create_script_for_old_cluster_deletion(char **deletion_script_file_name);
/* controldata.c */
@@ -402,12 +403,12 @@ void new_9_0_populate_pg_largeobject_metadata(
/* version_old_8_3.c */
-void old_8_3_check_for_name_data_type_usage(Cluster whichCluster);
-void old_8_3_check_for_tsquery_usage(Cluster whichCluster);
+void old_8_3_check_for_name_data_type_usage(Cluster whichCluster);
+void old_8_3_check_for_tsquery_usage(Cluster whichCluster);
void old_8_3_rebuild_tsvector_tables(bool check_mode,
- Cluster whichCluster);
+ Cluster whichCluster);
void old_8_3_invalidate_hash_gin_indexes(bool check_mode,
- Cluster whichCluster);
+ Cluster whichCluster);
void old_8_3_invalidate_bpchar_pattern_ops_indexes(bool check_mode,
- Cluster whichCluster);
-char *old_8_3_create_sequence_script(Cluster whichCluster);
+ Cluster whichCluster);
+char *old_8_3_create_sequence_script(Cluster whichCluster);
diff --git a/contrib/pg_upgrade/relfilenode.c b/contrib/pg_upgrade/relfilenode.c
index c1836ef8b89..ff1a73cdec2 100644
--- a/contrib/pg_upgrade/relfilenode.c
+++ b/contrib/pg_upgrade/relfilenode.c
@@ -63,7 +63,7 @@ transfer_all_new_dbs(DbInfoArr *olddb_arr,
}
}
- prep_status(""); /* in case nothing printed */
+ prep_status(""); /* in case nothing printed */
check_ok();
return msg;
@@ -122,9 +122,9 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
/* Copying files might take some time, so give feedback. */
snprintf(old_file, sizeof(old_file), "%s/%u", maps[mapnum].old_file,
- maps[mapnum].old_relfilenode);
+ maps[mapnum].old_relfilenode);
snprintf(new_file, sizeof(new_file), "%s/%u", maps[mapnum].new_file,
- maps[mapnum].new_relfilenode);
+ maps[mapnum].new_relfilenode);
pg_log(PG_REPORT, OVERWRITE_MESSAGE, old_file);
/*
@@ -142,7 +142,7 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
* Now copy/link any fsm and vm files, if they exist
*/
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u_",
- maps[mapnum].old_relfilenode);
+ maps[mapnum].old_relfilenode);
numFiles = pg_scandir(maps[mapnum].old_file, &namelist, dir_matching_filenames);
while (numFiles--)
@@ -150,7 +150,7 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
snprintf(old_file, sizeof(old_file), "%s/%s", maps[mapnum].old_file,
namelist[numFiles]->d_name);
snprintf(new_file, sizeof(new_file), "%s/%u%s", maps[mapnum].new_file,
- maps[mapnum].new_relfilenode, strchr(namelist[numFiles]->d_name, '_'));
+ maps[mapnum].new_relfilenode, strchr(namelist[numFiles]->d_name, '_'));
unlink(new_file);
transfer_relfile(pageConverter, old_file, new_file,
@@ -171,7 +171,7 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
* copied.
*/
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u.",
- maps[mapnum].old_relfilenode);
+ maps[mapnum].old_relfilenode);
numFiles = pg_scandir(maps[mapnum].old_file, &namelist, dir_matching_filenames);
while (numFiles--)
@@ -179,7 +179,7 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
snprintf(old_file, sizeof(old_file), "%s/%s", maps[mapnum].old_file,
namelist[numFiles]->d_name);
snprintf(new_file, sizeof(new_file), "%s/%u%s", maps[mapnum].new_file,
- maps[mapnum].new_relfilenode, strchr(namelist[numFiles]->d_name, '.'));
+ maps[mapnum].new_relfilenode, strchr(namelist[numFiles]->d_name, '.'));
unlink(new_file);
transfer_relfile(pageConverter, old_file, new_file,
diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
index af8109aa3d8..95c84670f89 100644
--- a/contrib/pg_upgrade/server.c
+++ b/contrib/pg_upgrade/server.c
@@ -36,7 +36,7 @@ connectToServer(const char *db_name,
PGconn *conn;
snprintf(connectString, sizeof(connectString),
- "dbname = '%s' user = '%s' port = %d", db_name, os_info.user, port);
+ "dbname = '%s' user = '%s' port = %d", db_name, os_info.user, port);
conn = PQconnectdb(connectString);
@@ -175,8 +175,8 @@ start_postmaster(Cluster whichCluster, bool quiet)
/*
* On Win32, we can't send both pg_upgrade output and pg_ctl output to the
* same file because we get the error: "The process cannot access the file
- * because it is being used by another process." so we have to send all other
- * output to 'nul'.
+ * because it is being used by another process." so we have to send all
+ * other output to 'nul'.
*/
snprintf(cmd, sizeof(cmd),
SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" "
@@ -260,7 +260,7 @@ test_server_conn(int timeout, Cluster whichCluster)
bool ret = false;
snprintf(con_opts, sizeof(con_opts),
- "dbname = 'template1' user = '%s' port = %d ", os_info.user, port);
+ "dbname = 'template1' user = '%s' port = %d ", os_info.user, port);
for (tries = 0; tries < timeout; tries++)
{
diff --git a/contrib/pg_upgrade/tablespace.c b/contrib/pg_upgrade/tablespace.c
index 6dc274a1afd..1f361b65ab9 100644
--- a/contrib/pg_upgrade/tablespace.c
+++ b/contrib/pg_upgrade/tablespace.c
@@ -23,7 +23,7 @@ init_tablespaces(void)
set_tablespace_directory_suffix(CLUSTER_NEW);
if (os_info.num_tablespaces > 0 &&
- strcmp(old_cluster.tablespace_suffix, new_cluster.tablespace_suffix) == 0)
+ strcmp(old_cluster.tablespace_suffix, new_cluster.tablespace_suffix) == 0)
pg_log(PG_FATAL,
"Cannot migrate to/from the same system catalog version when\n"
"using tablespaces.\n");
@@ -52,7 +52,7 @@ get_tablespace_paths(void)
if ((os_info.num_tablespaces = PQntuples(res)) != 0)
os_info.tablespaces = (char **) pg_malloc(
- os_info.num_tablespaces * sizeof(char *));
+ os_info.num_tablespaces * sizeof(char *));
else
os_info.tablespaces = NULL;
@@ -81,8 +81,8 @@ set_tablespace_directory_suffix(Cluster whichCluster)
{
/* This cluster has a version-specific subdirectory */
active_cluster->tablespace_suffix = pg_malloc(4 +
- strlen(active_cluster->major_version_str) +
- 10 /* OIDCHARS */ + 1);
+ strlen(active_cluster->major_version_str) +
+ 10 /* OIDCHARS */ + 1);
/* The leading slash is needed to start a new directory. */
sprintf(active_cluster->tablespace_suffix, "/PG_%s_%d", active_cluster->major_version_str,
diff --git a/contrib/pg_upgrade/version_old_8_3.c b/contrib/pg_upgrade/version_old_8_3.c
index b5ec6f473ea..cc0a71b10bb 100644
--- a/contrib/pg_upgrade/version_old_8_3.c
+++ b/contrib/pg_upgrade/version_old_8_3.c
@@ -293,8 +293,8 @@ old_8_3_rebuild_tsvector_tables(bool check_mode,
if (strlen(old_nspname) != 0 || strlen(old_relname) != 0)
fprintf(script, ";\n\n");
fprintf(script, "ALTER TABLE %s.%s\n",
- quote_identifier(PQgetvalue(res, rowno, i_nspname)),
- quote_identifier(PQgetvalue(res, rowno, i_relname)));
+ quote_identifier(PQgetvalue(res, rowno, i_nspname)),
+ quote_identifier(PQgetvalue(res, rowno, i_relname)));
}
else
fprintf(script, ",\n");
@@ -304,8 +304,8 @@ old_8_3_rebuild_tsvector_tables(bool check_mode,
fprintf(script, "ALTER COLUMN %s "
/* This could have been a custom conversion function call. */
"TYPE pg_catalog.tsvector USING %s::pg_catalog.text::pg_catalog.tsvector",
- quote_identifier(PQgetvalue(res, rowno, i_attname)),
- quote_identifier(PQgetvalue(res, rowno, i_attname)));
+ quote_identifier(PQgetvalue(res, rowno, i_attname)),
+ quote_identifier(PQgetvalue(res, rowno, i_attname)));
}
}
if (strlen(old_nspname) != 0 || strlen(old_relname) != 0)
@@ -407,8 +407,8 @@ old_8_3_invalidate_hash_gin_indexes(bool check_mode,
db_used = true;
}
fprintf(script, "REINDEX INDEX %s.%s;\n",
- quote_identifier(PQgetvalue(res, rowno, i_nspname)),
- quote_identifier(PQgetvalue(res, rowno, i_relname)));
+ quote_identifier(PQgetvalue(res, rowno, i_nspname)),
+ quote_identifier(PQgetvalue(res, rowno, i_relname)));
}
}
@@ -532,8 +532,8 @@ old_8_3_invalidate_bpchar_pattern_ops_indexes(bool check_mode,
db_used = true;
}
fprintf(script, "REINDEX INDEX %s.%s;\n",
- quote_identifier(PQgetvalue(res, rowno, i_nspname)),
- quote_identifier(PQgetvalue(res, rowno, i_relname)));
+ quote_identifier(PQgetvalue(res, rowno, i_nspname)),
+ quote_identifier(PQgetvalue(res, rowno, i_relname)));
}
}
@@ -669,7 +669,7 @@ old_8_3_create_sequence_script(Cluster whichCluster)
i_is_called = PQfnumber(seq_res, "is_called");
fprintf(script, "SELECT setval('%s.%s', %s, '%s');\n",
- quote_identifier(nspname), quote_identifier(relname),
+ quote_identifier(nspname), quote_identifier(relname),
PQgetvalue(seq_res, 0, i_last_value), PQgetvalue(seq_res, 0, i_is_called));
PQclear(seq_res);
}