aboutsummaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2010-02-26 02:01:40 +0000
committerBruce Momjian <bruce@momjian.us>2010-02-26 02:01:40 +0000
commit65e806cba1f0f154d51caa7478e7192ce58d1056 (patch)
tree99a656d7b4ec6d038d4c24e07fadf75db4c37e79 /src/bin
parent16040575a04486d8e0823b4e304f4933144baf90 (diff)
downloadpostgresql-65e806cba1f0f154d51caa7478e7192ce58d1056.tar.gz
postgresql-65e806cba1f0f154d51caa7478e7192ce58d1056.zip
pgindent run for 9.0
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/initdb/initdb.c8
-rw-r--r--src/bin/pg_ctl/pg_ctl.c8
-rw-r--r--src/bin/pg_dump/dumputils.c18
-rw-r--r--src/bin/pg_dump/dumputils.h6
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c36
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h8
-rw-r--r--src/bin/pg_dump/pg_backup_db.c59
-rw-r--r--src/bin/pg_dump/pg_backup_tar.c8
-rw-r--r--src/bin/pg_dump/pg_dump.c202
-rw-r--r--src/bin/pg_dump/pg_dump.h8
-rw-r--r--src/bin/pg_dump/pg_dump_sort.c8
-rw-r--r--src/bin/pg_dump/pg_dumpall.c36
-rw-r--r--src/bin/pg_resetxlog/pg_resetxlog.c10
-rw-r--r--src/bin/psql/command.c34
-rw-r--r--src/bin/psql/describe.c56
-rw-r--r--src/bin/psql/input.c12
-rw-r--r--src/bin/psql/input.h9
-rw-r--r--src/bin/psql/large_obj.c8
-rw-r--r--src/bin/psql/mainloop.c4
-rw-r--r--src/bin/psql/print.c48
-rw-r--r--src/bin/psql/print.h16
-rw-r--r--src/bin/psql/startup.c34
-rw-r--r--src/bin/psql/tab-complete.c21
-rw-r--r--src/bin/scripts/common.c30
-rw-r--r--src/bin/scripts/droplang.c8
-rw-r--r--src/bin/scripts/vacuumdb.c4
26 files changed, 350 insertions, 349 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 733d8ef74d2..0aee70de1d6 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -42,7 +42,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.185 2010/02/16 22:34:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.186 2010/02/26 02:01:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1215,8 +1215,8 @@ setup_config(void)
if (err != 0 ||
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");
}
#else /* !HAVE_IPV6 */
/* If we didn't compile IPV6 support at all, always comment it out */
@@ -2345,7 +2345,7 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo)
}
#ifndef __CYGWIN__
- AddUserToTokenDacl(restrictedToken);
+ AddUserToTokenDacl(restrictedToken);
#endif
if (!CreateProcessAsUser(restrictedToken,
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 23d32e64697..04b8b2f0a0a 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.119 2010/02/19 14:12:19 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.120 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -651,7 +651,7 @@ find_other_exec_or_die(const char *argv0, const char *target, const char *versio
static void
do_init(void)
{
- char cmd[MAXPGPATH];
+ char cmd[MAXPGPATH];
if (exec_path == NULL)
exec_path = find_other_exec_or_die(argv0, "initdb", "initdb (PostgreSQL) " PG_VERSION "\n");
@@ -668,7 +668,7 @@ do_init(void)
else
snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s > \"%s\"" SYSTEMQUOTE,
exec_path, pgdata_opt, post_opts, DEVNULL);
-
+
if (system(cmd) != 0)
{
write_stderr(_("%s: database system initialization failed\n"), progname);
@@ -1605,7 +1605,7 @@ do_help(void)
#endif
printf(_(" -l, --log FILENAME write (or append) server log to FILENAME\n"));
printf(_(" -o OPTIONS command line options to pass to postgres\n"
- " (PostgreSQL server executable) or initdb\n"));
+ " (PostgreSQL server executable) or initdb\n"));
printf(_(" -p PATH-TO-POSTGRES normally not necessary\n"));
printf(_("\nOptions for stop or restart:\n"));
printf(_(" -m SHUTDOWN-MODE can be \"smart\", \"fast\", or \"immediate\"\n"));
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index 3452944a426..82b3cb26883 100644
--- a/src/bin/pg_dump/dumputils.c
+++ b/src/bin/pg_dump/dumputils.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.54 2010/02/18 01:29:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.55 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -343,10 +343,10 @@ appendByteaLiteral(PQExpBuffer buf, const unsigned char *str, size_t length,
static const char hextbl[] = "0123456789abcdef";
/*
- * This implementation is hard-wired to produce hex-format output.
- * We do not know the server version the output will be loaded into,
- * so making an intelligent format choice is impossible. It might be
- * better to always use the old escaped format.
+ * This implementation is hard-wired to produce hex-format output. We do
+ * not know the server version the output will be loaded into, so making
+ * an intelligent format choice is impossible. It might be better to
+ * always use the old escaped format.
*/
if (!enlargePQExpBuffer(buf, 2 * length + 5))
return;
@@ -611,7 +611,7 @@ buildACLCommands(const char *name, const char *subname,
fmtId(grantee->data));
if (privswgo->len > 0)
appendPQExpBuffer(firstsql,
- "%sGRANT %s ON %s %s TO %s WITH GRANT OPTION;\n",
+ "%sGRANT %s ON %s %s TO %s WITH GRANT OPTION;\n",
prefix, privswgo->data, type, name,
fmtId(grantee->data));
}
@@ -712,9 +712,9 @@ buildDefaultACLCommands(const char *type, const char *nspname,
/*
* We incorporate the target role directly into the command, rather than
- * playing around with SET ROLE or anything like that. This is so that
- * a permissions error leads to nothing happening, rather than
- * changing default privileges for the wrong user.
+ * playing around with SET ROLE or anything like that. This is so that a
+ * permissions error leads to nothing happening, rather than changing
+ * default privileges for the wrong user.
*/
appendPQExpBuffer(prefix, "ALTER DEFAULT PRIVILEGES FOR ROLE %s ",
fmtId(owner));
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h
index f8cb3778974..298b687cd1d 100644
--- a/src/bin/pg_dump/dumputils.h
+++ b/src/bin/pg_dump/dumputils.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.h,v 1.28 2010/01/02 16:57:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.h,v 1.29 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,8 +28,8 @@ extern void appendStringLiteralConn(PQExpBuffer buf, const char *str,
extern void appendStringLiteralDQ(PQExpBuffer buf, const char *str,
const char *dqprefix);
extern void appendByteaLiteral(PQExpBuffer buf,
- const unsigned char *str, size_t length,
- bool std_strings);
+ const unsigned char *str, size_t length,
+ bool std_strings);
extern int parse_version(const char *versionString);
extern bool parsePGArray(const char *atext, char ***itemarray, int *nitems);
extern bool buildACLCommands(const char *name, const char *subname,
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index af290363ff9..4d1205d2d14 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.181 2010/02/24 02:42:54 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.182 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -138,7 +138,7 @@ static void identify_locking_dependencies(TocEntry *te,
TocEntry **tocsByDumpId,
DumpId maxDumpId);
static void reduce_dependencies(ArchiveHandle *AH, TocEntry *te,
- TocEntry *ready_list);
+ TocEntry *ready_list);
static void mark_create_done(ArchiveHandle *AH, TocEntry *te);
static void inhibit_data_for_failed_table(ArchiveHandle *AH, TocEntry *te);
static ArchiveHandle *CloneArchive(ArchiveHandle *AH);
@@ -339,7 +339,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
reqs = _tocEntryRequired(te, ropt, false /* needn't drop ACLs */ );
/* We want anything that's selected and has a dropStmt */
- if (((reqs & (REQ_SCHEMA|REQ_DATA)) != 0) && te->dropStmt)
+ if (((reqs & (REQ_SCHEMA | REQ_DATA)) != 0) && te->dropStmt)
{
ahlog(AH, 1, "dropping %s %s\n", te->desc, te->tag);
/* Select owner and schema as necessary */
@@ -391,7 +391,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
reqs = _tocEntryRequired(te, ropt, true);
/* Both schema and data objects might now have ownership/ACLs */
- if ((reqs & (REQ_SCHEMA|REQ_DATA)) != 0)
+ if ((reqs & (REQ_SCHEMA | REQ_DATA)) != 0)
{
ahlog(AH, 1, "setting owner and privileges for %s %s\n",
te->desc, te->tag);
@@ -2311,11 +2311,11 @@ _tocEntryRequired(TocEntry *te, RestoreOptions *ropt, bool include_acls)
if (!te->hadDumper)
{
/*
- * Special Case: If 'SEQUENCE SET' or anything to do with BLOBs,
- * then it is considered a data entry. We don't need to check for
- * the BLOBS entry or old-style BLOB COMMENTS, because they will
- * have hadDumper = true ... but we do need to check new-style
- * BLOB comments.
+ * Special Case: If 'SEQUENCE SET' or anything to do with BLOBs, then
+ * it is considered a data entry. We don't need to check for the
+ * BLOBS entry or old-style BLOB COMMENTS, because they will have
+ * hadDumper = true ... but we do need to check new-style BLOB
+ * comments.
*/
if (strcmp(te->desc, "SEQUENCE SET") == 0 ||
strcmp(te->desc, "BLOB") == 0 ||
@@ -3197,13 +3197,13 @@ restore_toc_entries_parallel(ArchiveHandle *AH)
AH->currWithOids = -1;
/*
- * Initialize the lists of pending and ready items. After this setup,
- * the pending list is everything that needs to be done but is blocked
- * by one or more dependencies, while the ready list contains items that
- * have no remaining dependencies. Note: we don't yet filter out entries
- * that aren't going to be restored. They might participate in
- * dependency chains connecting entries that should be restored, so we
- * treat them as live until we actually process them.
+ * Initialize the lists of pending and ready items. After this setup, the
+ * pending list is everything that needs to be done but is blocked by one
+ * or more dependencies, while the ready list contains items that have no
+ * remaining dependencies. Note: we don't yet filter out entries that
+ * aren't going to be restored. They might participate in dependency
+ * chains connecting entries that should be restored, so we treat them as
+ * live until we actually process them.
*/
par_list_header_init(&pending_list);
par_list_header_init(&ready_list);
@@ -3716,8 +3716,8 @@ fix_dependencies(ArchiveHandle *AH)
* repeatedly. Entries for dump IDs not present in the TOC will be NULL.
*
* NOTE: because maxDumpId is just the highest dump ID defined in the
- * archive, there might be dependencies for IDs > maxDumpId. All uses
- * of this array must guard against out-of-range dependency numbers.
+ * archive, there might be dependencies for IDs > maxDumpId. All uses of
+ * this array must guard against out-of-range dependency numbers.
*
* Also, initialize the depCount fields, and make sure all the TOC items
* are marked as not being in any parallel-processing list.
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index dc2ccb5e95a..0a135ee126f 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.84 2010/02/18 01:29:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.85 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -317,8 +317,8 @@ typedef struct _tocEntry
void *formatData; /* TOC Entry data specific to file format */
/* working state (needed only for parallel restore) */
- struct _tocEntry *par_prev; /* list links for pending/ready items; */
- struct _tocEntry *par_next; /* these are NULL if not in either list */
+ struct _tocEntry *par_prev; /* list links for pending/ready items; */
+ struct _tocEntry *par_next; /* these are NULL if not in either list */
bool created; /* set for DATA member if TABLE was created */
int depCount; /* number of dependencies not yet restored */
DumpId *lockDeps; /* dumpIds of objects this one needs lock on */
@@ -374,7 +374,7 @@ extern void InitArchiveFmt_Tar(ArchiveHandle *AH);
extern bool isValidTarHeader(char *header);
extern int ReconnectToServer(ArchiveHandle *AH, const char *dbname, const char *newUser);
-extern void DropBlobIfExists(ArchiveHandle *AH, Oid oid);
+extern void DropBlobIfExists(ArchiveHandle *AH, Oid oid);
int ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH);
int ahprintf(ArchiveHandle *AH, const char *fmt,...) __attribute__((format(printf, 2, 3)));
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 37e6d2005df..37d1b742e41 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.89 2010/02/24 02:42:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.90 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -163,20 +163,20 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
if (!keywords || !values)
die_horribly(AH, modulename, "out of memory\n");
- keywords[0] = "host";
- values[0] = PQhost(AH->connection);
- keywords[1] = "port";
- values[1] = PQport(AH->connection);
- keywords[2] = "user";
- values[2] = newuser;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = newdb;
- keywords[5] = "fallback_application_name";
- values[5] = progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "host";
+ values[0] = PQhost(AH->connection);
+ keywords[1] = "port";
+ values[1] = PQport(AH->connection);
+ keywords[2] = "user";
+ values[2] = newuser;
+ keywords[3] = "password";
+ values[3] = password;
+ keywords[4] = "dbname";
+ values[4] = newdb;
+ keywords[5] = "fallback_application_name";
+ values[5] = progname;
+ keywords[6] = NULL;
+ values[6] = NULL;
new_pass = false;
newConn = PQconnectdbParams(keywords, values, true);
@@ -270,20 +270,20 @@ ConnectDatabase(Archive *AHX,
if (!keywords || !values)
die_horribly(AH, modulename, "out of memory\n");
- keywords[0] = "host";
- values[0] = pghost;
- keywords[1] = "port";
- values[1] = pgport;
- keywords[2] = "user";
- values[2] = username;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "host";
+ values[0] = pghost;
+ keywords[1] = "port";
+ values[1] = pgport;
+ keywords[2] = "user";
+ values[2] = username;
+ keywords[3] = "password";
+ values[3] = password;
+ keywords[4] = "dbname";
+ values[4] = dbname;
+ keywords[5] = "fallback_application_name";
+ values[5] = progname;
+ keywords[6] = NULL;
+ values[6] = NULL;
new_pass = false;
AH->connection = PQconnectdbParams(keywords, values, true);
@@ -757,4 +757,3 @@ _isDQChar(unsigned char c, bool atStart)
else
return false;
}
-
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index da353346361..2871fee15d3 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.68 2010/02/23 16:55:22 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.69 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -350,8 +350,8 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
if (filename)
{
/*
- * Couldn't find the requested file. Future:
- * do SEEK(0) and retry.
+ * Couldn't find the requested file. Future: do SEEK(0) and
+ * retry.
*/
die_horribly(AH, modulename, "could not find file \"%s\" in archive\n", filename);
}
@@ -1178,7 +1178,7 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
id = atoi(th->targetFile);
if ((TocIDRequired(AH, id, AH->ropt) & REQ_DATA) != 0)
die_horribly(AH, modulename, "restoring data out of order is not supported in this archive format: "
- "\"%s\" is required, but comes before \"%s\" in the archive file.\n",
+ "\"%s\" is required, but comes before \"%s\" in the archive file.\n",
th->targetFile, filename);
/* Header doesn't match, so read to next header */
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 95c08f11f97..950f7ffdbda 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.574 2010/02/24 02:15:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.575 2010/02/26 02:01:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -196,11 +196,11 @@ static void dumpDatabase(Archive *AH);
static void dumpEncoding(Archive *AH);
static void dumpStdStrings(Archive *AH);
static void binary_upgrade_set_type_oids_by_type_oid(
- PQExpBuffer upgrade_buffer, Oid pg_type_oid);
+ PQExpBuffer upgrade_buffer, Oid pg_type_oid);
static bool binary_upgrade_set_type_oids_by_rel_oid(
- PQExpBuffer upgrade_buffer, Oid pg_rel_oid);
+ PQExpBuffer upgrade_buffer, Oid pg_rel_oid);
static void binary_upgrade_set_relfilenodes(PQExpBuffer upgrade_buffer,
- Oid pg_class_oid, bool is_index);
+ Oid pg_class_oid, bool is_index);
static const char *getAttrName(int attrnum, TableInfo *tblInfo);
static const char *fmtCopyColumnList(const TableInfo *ti);
static void do_sql_command(PGconn *conn, const char *query);
@@ -1778,8 +1778,8 @@ dumpDatabase(Archive *AH)
NULL); /* Dumper Arg */
/*
- * pg_largeobject comes from the old system intact, so set
- * its relfrozenxid.
+ * pg_largeobject comes from the old system intact, so set its
+ * relfrozenxid.
*/
if (binary_upgrade)
{
@@ -1789,9 +1789,9 @@ dumpDatabase(Archive *AH)
int i_relfrozenxid;
appendPQExpBuffer(loFrozenQry, "SELECT relfrozenxid\n"
- "FROM pg_catalog.pg_class\n"
- "WHERE oid = %u;\n",
- LargeObjectRelationId);
+ "FROM pg_catalog.pg_class\n"
+ "WHERE oid = %u;\n",
+ LargeObjectRelationId);
lo_res = PQexec(g_conn, loFrozenQry->data);
check_sql_result(lo_res, g_conn, loFrozenQry->data, PGRES_TUPLES_OK);
@@ -1926,10 +1926,10 @@ dumpStdStrings(Archive *AH)
static void
getBlobs(Archive *AH)
{
- PQExpBuffer blobQry = createPQExpBuffer();
- BlobInfo *binfo;
+ PQExpBuffer blobQry = createPQExpBuffer();
+ BlobInfo *binfo;
DumpableObject *bdata;
- PGresult *res;
+ PGresult *res;
int ntups;
int i;
@@ -2007,8 +2007,8 @@ getBlobs(Archive *AH)
static void
dumpBlob(Archive *AH, BlobInfo *binfo)
{
- PQExpBuffer cquery = createPQExpBuffer();
- PQExpBuffer dquery = createPQExpBuffer();
+ PQExpBuffer cquery = createPQExpBuffer();
+ PQExpBuffer dquery = createPQExpBuffer();
appendPQExpBuffer(cquery,
"SELECT pg_catalog.lo_create('%s');\n",
@@ -2068,8 +2068,8 @@ dumpBlobs(Archive *AH, void *arg)
selectSourceSchema("pg_catalog");
/*
- * Currently, we re-fetch all BLOB OIDs using a cursor. Consider
- * scanning the already-in-memory dumpable objects instead...
+ * Currently, we re-fetch all BLOB OIDs using a cursor. Consider scanning
+ * the already-in-memory dumpable objects instead...
*/
if (AH->remoteVersion >= 90000)
blobQry = "DECLARE bloboid CURSOR FOR SELECT oid FROM pg_largeobject_metadata";
@@ -2138,17 +2138,17 @@ dumpBlobs(Archive *AH, void *arg)
static void
binary_upgrade_set_type_oids_by_type_oid(PQExpBuffer upgrade_buffer,
- Oid pg_type_oid)
+ Oid pg_type_oid)
{
PQExpBuffer upgrade_query = createPQExpBuffer();
int ntups;
PGresult *upgrade_res;
Oid pg_type_array_oid;
-
+
appendPQExpBuffer(upgrade_buffer, "\n-- For binary upgrade, must preserve pg_type oid\n");
appendPQExpBuffer(upgrade_buffer,
- "SELECT binary_upgrade.set_next_pg_type_oid('%u'::pg_catalog.oid);\n\n",
- pg_type_oid);
+ "SELECT binary_upgrade.set_next_pg_type_oid('%u'::pg_catalog.oid);\n\n",
+ pg_type_oid);
/* we only support old >= 8.3 for binary upgrades */
appendPQExpBuffer(upgrade_query,
@@ -2176,10 +2176,10 @@ binary_upgrade_set_type_oids_by_type_oid(PQExpBuffer upgrade_buffer,
if (OidIsValid(pg_type_array_oid))
{
appendPQExpBuffer(upgrade_buffer,
- "\n-- For binary upgrade, must preserve pg_type array oid\n");
+ "\n-- For binary upgrade, must preserve pg_type array oid\n");
appendPQExpBuffer(upgrade_buffer,
- "SELECT binary_upgrade.set_next_pg_type_array_oid('%u'::pg_catalog.oid);\n\n",
- pg_type_array_oid);
+ "SELECT binary_upgrade.set_next_pg_type_array_oid('%u'::pg_catalog.oid);\n\n",
+ pg_type_array_oid);
}
PQclear(upgrade_res);
@@ -2188,14 +2188,14 @@ binary_upgrade_set_type_oids_by_type_oid(PQExpBuffer upgrade_buffer,
static bool
binary_upgrade_set_type_oids_by_rel_oid(PQExpBuffer upgrade_buffer,
- Oid pg_rel_oid)
+ Oid pg_rel_oid)
{
PQExpBuffer upgrade_query = createPQExpBuffer();
int ntups;
PGresult *upgrade_res;
Oid pg_type_oid;
bool toast_set = false;
-
+
/* we only support old >= 8.3 for binary upgrades */
appendPQExpBuffer(upgrade_query,
"SELECT c.reltype AS crel, t.reltype AS trel "
@@ -2226,13 +2226,13 @@ binary_upgrade_set_type_oids_by_rel_oid(PQExpBuffer upgrade_buffer,
if (!PQgetisnull(upgrade_res, 0, PQfnumber(upgrade_res, "trel")))
{
/* Toast tables do not have pg_type array rows */
- Oid pg_type_toast_oid = atooid(PQgetvalue(upgrade_res, 0,
- PQfnumber(upgrade_res, "trel")));
+ Oid pg_type_toast_oid = atooid(PQgetvalue(upgrade_res, 0,
+ PQfnumber(upgrade_res, "trel")));
appendPQExpBuffer(upgrade_buffer, "\n-- For binary upgrade, must preserve pg_type toast oid\n");
appendPQExpBuffer(upgrade_buffer,
- "SELECT binary_upgrade.set_next_pg_type_toast_oid('%u'::pg_catalog.oid);\n\n",
- pg_type_toast_oid);
+ "SELECT binary_upgrade.set_next_pg_type_toast_oid('%u'::pg_catalog.oid);\n\n",
+ pg_type_toast_oid);
toast_set = true;
}
@@ -2256,12 +2256,12 @@ binary_upgrade_set_relfilenodes(PQExpBuffer upgrade_buffer, Oid pg_class_oid,
/*
* Note: we don't need to use pg_relation_filenode() here because this
- * function is not intended to be used against system catalogs.
- * Otherwise we'd have to worry about which versions pg_relation_filenode
- * is available in.
+ * function is not intended to be used against system catalogs. Otherwise
+ * we'd have to worry about which versions pg_relation_filenode is
+ * available in.
*/
appendPQExpBuffer(upgrade_query,
- "SELECT c.relfilenode, c.reltoastrelid, t.reltoastidxid "
+ "SELECT c.relfilenode, c.reltoastrelid, t.reltoastidxid "
"FROM pg_catalog.pg_class c LEFT JOIN "
"pg_catalog.pg_class t ON (c.reltoastrelid = t.oid) "
"WHERE c.oid = '%u'::pg_catalog.oid;",
@@ -2286,37 +2286,36 @@ binary_upgrade_set_relfilenodes(PQExpBuffer upgrade_buffer, Oid pg_class_oid,
pg_class_reltoastidxid = atooid(PQgetvalue(upgrade_res, 0, PQfnumber(upgrade_res, "reltoastidxid")));
appendPQExpBuffer(upgrade_buffer,
- "\n-- For binary upgrade, must preserve relfilenodes\n");
+ "\n-- For binary upgrade, must preserve relfilenodes\n");
if (!is_index)
appendPQExpBuffer(upgrade_buffer,
- "SELECT binary_upgrade.set_next_heap_relfilenode('%u'::pg_catalog.oid);\n",
- pg_class_relfilenode);
+ "SELECT binary_upgrade.set_next_heap_relfilenode('%u'::pg_catalog.oid);\n",
+ pg_class_relfilenode);
else
appendPQExpBuffer(upgrade_buffer,
- "SELECT binary_upgrade.set_next_index_relfilenode('%u'::pg_catalog.oid);\n",
- pg_class_relfilenode);
-
+ "SELECT binary_upgrade.set_next_index_relfilenode('%u'::pg_catalog.oid);\n",
+ pg_class_relfilenode);
+
if (OidIsValid(pg_class_reltoastrelid))
{
/*
- * One complexity is that the table definition might not require
- * the creation of a TOAST table, and the TOAST table might have
- * been created long after table creation, when the table was
- * loaded with wide data. By setting the TOAST relfilenode we
- * force creation of the TOAST heap and TOAST index by the
- * backend so we can cleanly migrate the files during binary
- * migration.
+ * One complexity is that the table definition might not require the
+ * creation of a TOAST table, and the TOAST table might have been
+ * created long after table creation, when the table was loaded with
+ * wide data. By setting the TOAST relfilenode we force creation of
+ * the TOAST heap and TOAST index by the backend so we can cleanly
+ * migrate the files during binary migration.
*/
appendPQExpBuffer(upgrade_buffer,
- "SELECT binary_upgrade.set_next_toast_relfilenode('%u'::pg_catalog.oid);\n",
- pg_class_reltoastrelid);
+ "SELECT binary_upgrade.set_next_toast_relfilenode('%u'::pg_catalog.oid);\n",
+ pg_class_reltoastrelid);
/* every toast table has an index */
appendPQExpBuffer(upgrade_buffer,
- "SELECT binary_upgrade.set_next_index_relfilenode('%u'::pg_catalog.oid);\n",
- pg_class_reltoastidxid);
+ "SELECT binary_upgrade.set_next_index_relfilenode('%u'::pg_catalog.oid);\n",
+ pg_class_reltoastidxid);
}
appendPQExpBuffer(upgrade_buffer, "\n");
@@ -2612,7 +2611,7 @@ getTypes(int *numTypes)
AssignDumpId(&tyinfo[i].dobj);
tyinfo[i].dobj.name = strdup(PQgetvalue(res, i, i_typname));
tyinfo[i].dobj.namespace = findNamespace(atooid(PQgetvalue(res, i, i_typnamespace)),
- tyinfo[i].dobj.catId.oid);
+ tyinfo[i].dobj.catId.oid);
tyinfo[i].rolname = strdup(PQgetvalue(res, i, i_rolname));
tyinfo[i].typelem = atooid(PQgetvalue(res, i, i_typelem));
tyinfo[i].typrelid = atooid(PQgetvalue(res, i, i_typrelid));
@@ -3958,7 +3957,7 @@ getIndexes(TableInfo tblinfo[], int numTables)
"c.condeferrable, c.condeferred, "
"c.tableoid AS contableoid, "
"c.oid AS conoid, "
- "pg_catalog.pg_get_constraintdef(c.oid, false) AS condef, "
+ "pg_catalog.pg_get_constraintdef(c.oid, false) AS condef, "
"(SELECT spcname FROM pg_catalog.pg_tablespace s WHERE s.oid = t.reltablespace) AS tablespace, "
"array_to_string(t.reloptions, ', ') AS options "
"FROM pg_catalog.pg_index i "
@@ -4586,7 +4585,7 @@ getTriggers(TableInfo tblinfo[], int numTables)
appendPQExpBuffer(query,
"SELECT tgname, "
"tgfoid::pg_catalog.regproc AS tgfname, "
- "pg_catalog.pg_get_triggerdef(oid, false) AS tgdef, "
+ "pg_catalog.pg_get_triggerdef(oid, false) AS tgdef, "
"tgenabled, tableoid, oid "
"FROM pg_catalog.pg_trigger t "
"WHERE tgrelid = '%u'::pg_catalog.oid "
@@ -5112,8 +5111,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
"a.attstattarget, a.attstorage, t.typstorage, "
"a.attnotnull, a.atthasdef, a.attisdropped, "
"a.attlen, a.attalign, a.attislocal, "
- "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
- "array_to_string(attoptions, ', ') AS attoptions "
+ "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
+ "array_to_string(attoptions, ', ') AS attoptions "
"FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
"ON a.atttypid = t.oid "
"WHERE a.attrelid = '%u'::pg_catalog.oid "
@@ -5128,7 +5127,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
"a.attstattarget, a.attstorage, t.typstorage, "
"a.attnotnull, a.atthasdef, a.attisdropped, "
"a.attlen, a.attalign, a.attislocal, "
- "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
+ "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
"'' AS attoptions "
"FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
"ON a.atttypid = t.oid "
@@ -6035,7 +6034,7 @@ getDefaultACLs(int *numDefaultACLs)
for (i = 0; i < ntups; i++)
{
- Oid nspid = atooid(PQgetvalue(res, i, i_defaclnamespace));
+ Oid nspid = atooid(PQgetvalue(res, i, i_defaclnamespace));
daclinfo[i].dobj.objType = DO_DEFAULT_ACL;
daclinfo[i].dobj.catId.tableoid = atooid(PQgetvalue(res, i, i_tableoid));
@@ -6046,7 +6045,7 @@ getDefaultACLs(int *numDefaultACLs)
if (nspid != InvalidOid)
daclinfo[i].dobj.namespace = findNamespace(nspid,
- daclinfo[i].dobj.catId.oid);
+ daclinfo[i].dobj.catId.oid);
else
daclinfo[i].dobj.namespace = NULL;
@@ -6651,9 +6650,9 @@ dumpEnumType(Archive *fout, TypeInfo *tyinfo)
if (i == 0)
appendPQExpBuffer(q, "\n-- For binary upgrade, must preserve pg_enum oids\n");
appendPQExpBuffer(q,
- "SELECT binary_upgrade.add_pg_enum_label('%u'::pg_catalog.oid, "
- "'%u'::pg_catalog.oid, ",
- enum_oid, tyinfo->dobj.catId.oid);
+ "SELECT binary_upgrade.add_pg_enum_label('%u'::pg_catalog.oid, "
+ "'%u'::pg_catalog.oid, ",
+ enum_oid, tyinfo->dobj.catId.oid);
appendStringLiteralAH(q, label, fout);
appendPQExpBuffer(q, ");\n");
}
@@ -7208,8 +7207,8 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
/* We assume here that remoteVersion must be at least 70300 */
appendPQExpBuffer(query, "SELECT a.attname, "
- "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, "
- "typrelid "
+ "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, "
+ "typrelid "
"FROM pg_catalog.pg_type t, pg_catalog.pg_attribute a "
"WHERE t.oid = '%u'::pg_catalog.oid "
"AND a.attrelid = t.typrelid "
@@ -7234,8 +7233,8 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
if (binary_upgrade)
{
- Oid typrelid = atooid(PQgetvalue(res, 0, i_typrelid));
-
+ Oid typrelid = atooid(PQgetvalue(res, 0, i_typrelid));
+
binary_upgrade_set_type_oids_by_type_oid(q, tyinfo->dobj.catId.oid);
binary_upgrade_set_relfilenodes(q, typrelid, false);
}
@@ -7302,15 +7301,15 @@ static void
dumpCompositeTypeColComments(Archive *fout, TypeInfo *tyinfo)
{
CommentItem *comments;
- int ncomments;
- PGresult *res;
+ int ncomments;
+ PGresult *res;
PQExpBuffer query;
PQExpBuffer target;
- Oid pgClassOid;
- int i;
- int ntups;
- int i_attname;
- int i_attnum;
+ Oid pgClassOid;
+ int i;
+ int ntups;
+ int i_attname;
+ int i_attnum;
query = createPQExpBuffer();
@@ -7431,7 +7430,7 @@ dumpShellType(Archive *fout, ShellTypeInfo *stinfo)
if (binary_upgrade)
binary_upgrade_set_type_oids_by_type_oid(q,
- stinfo->baseType->dobj.catId.oid);
+ stinfo->baseType->dobj.catId.oid);
appendPQExpBuffer(q, "CREATE TYPE %s;\n",
fmtId(stinfo->dobj.name));
@@ -7561,7 +7560,7 @@ dumpProcLang(Archive *fout, ProcLangInfo *plang)
/* Cope with possibility that inline is in different schema */
if (inlineInfo->dobj.namespace != funcInfo->dobj.namespace)
appendPQExpBuffer(defqry, "%s.",
- fmtId(inlineInfo->dobj.namespace->dobj.name));
+ fmtId(inlineInfo->dobj.namespace->dobj.name));
appendPQExpBuffer(defqry, "%s",
fmtId(inlineInfo->dobj.name));
}
@@ -7579,10 +7578,10 @@ dumpProcLang(Archive *fout, ProcLangInfo *plang)
else
{
/*
- * If not dumping parameters, then use CREATE OR REPLACE so that
- * the command will not fail if the language is preinstalled in the
- * target database. We restrict the use of REPLACE to this case so
- * as to eliminate the risk of replacing a language with incompatible
+ * If not dumping parameters, then use CREATE OR REPLACE so that the
+ * command will not fail if the language is preinstalled in the target
+ * database. We restrict the use of REPLACE to this case so as to
+ * eliminate the risk of replacing a language with incompatible
* parameter settings: this command will only succeed at all if there
* is a pg_pltemplate entry, and if there is one, the existing entry
* must match it too.
@@ -10333,7 +10332,7 @@ dumpDefaultACL(Archive *fout, DefaultACLInfo *daclinfo)
ArchiveEntry(fout, daclinfo->dobj.catId, daclinfo->dobj.dumpId,
tag->data,
- daclinfo->dobj.namespace ? daclinfo->dobj.namespace->dobj.name : NULL,
+ daclinfo->dobj.namespace ? daclinfo->dobj.namespace->dobj.name : NULL,
NULL,
daclinfo->defaclrole,
false, "DEFAULT ACL", SECTION_NONE,
@@ -10489,13 +10488,13 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
int j,
k;
bool toast_set = false;
-
+
/* Make sure we are in proper schema */
selectSourceSchema(tbinfo->dobj.namespace->dobj.name);
if (binary_upgrade)
toast_set = 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)
@@ -10597,15 +10596,16 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
* binary-upgrade case, where we're not doing normal
* inheritance) or if it's to be printed separately.
*/
- bool has_default = (tbinfo->attrdefs[j] != NULL
- && (!tbinfo->inhAttrDef[j] || binary_upgrade)
- && !tbinfo->attrdefs[j]->separate);
+ bool has_default = (tbinfo->attrdefs[j] != NULL
+ && (!tbinfo->inhAttrDef[j] || binary_upgrade)
+ && !tbinfo->attrdefs[j]->separate);
+
/*
- * Not Null constraint --- suppress if inherited, except
- * in binary-upgrade case.
+ * Not Null constraint --- suppress if inherited, except in
+ * binary-upgrade case.
*/
- bool has_notnull = (tbinfo->notnull[j]
- && (!tbinfo->inhNotNull[j] || binary_upgrade));
+ bool has_notnull = (tbinfo->notnull[j]
+ && (!tbinfo->inhNotNull[j] || binary_upgrade));
if (tbinfo->reloftype && !has_default && !has_notnull)
continue;
@@ -10734,15 +10734,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
appendPQExpBuffer(q, ";\n");
/*
- * To create binary-compatible heap files, we have to ensure the
- * same physical column order, including dropped columns, as in the
- * original. Therefore, we create dropped columns above and drop
- * them here, also updating their attlen/attalign values so that
- * the dropped column can be skipped properly. (We do not bother
- * with restoring the original attbyval setting.) Also, inheritance
+ * To create binary-compatible heap files, we have to ensure the same
+ * physical column order, including dropped columns, as in the
+ * original. Therefore, we create dropped columns above and drop them
+ * here, also updating their attlen/attalign values so that the
+ * dropped column can be skipped properly. (We do not bother with
+ * restoring the original attbyval setting.) Also, inheritance
* relationships are set up by doing ALTER INHERIT rather than using
- * an INHERITS clause --- the latter would possibly mess up the
- * column order. That also means we have to take care about setting
+ * an INHERITS clause --- the latter would possibly mess up the column
+ * order. That also means we have to take care about setting
* attislocal correctly, plus fix up any inherited CHECK constraints.
*/
if (binary_upgrade)
@@ -10814,7 +10814,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
fmtId(tbinfo->dobj.name));
if (parentRel->dobj.namespace != tbinfo->dobj.namespace)
appendPQExpBuffer(q, "%s.",
- fmtId(parentRel->dobj.namespace->dobj.name));
+ fmtId(parentRel->dobj.namespace->dobj.name));
appendPQExpBuffer(q, "%s;\n",
fmtId(parentRel->dobj.name));
}
@@ -11142,7 +11142,7 @@ dumpConstraint(Archive *fout, ConstraintInfo *coninfo)
else
{
appendPQExpBuffer(q, "%s (",
- coninfo->contype == 'p' ? "PRIMARY KEY" : "UNIQUE");
+ coninfo->contype == 'p' ? "PRIMARY KEY" : "UNIQUE");
for (k = 0; k < indxinfo->indnkeys; k++)
{
int indkey = (int) indxinfo->indkeys[k];
@@ -11579,8 +11579,8 @@ dumpSequence(Archive *fout, TableInfo *tbinfo)
appendPQExpBuffer(query, ";\n");
- /* binary_upgrade: no need to clear TOAST table oid */
-
+ /* binary_upgrade: no need to clear TOAST table oid */
+
ArchiveEntry(fout, tbinfo->dobj.catId, tbinfo->dobj.dumpId,
tbinfo->dobj.name,
tbinfo->dobj.namespace->dobj.name,
@@ -11785,7 +11785,7 @@ dumpTrigger(Archive *fout, TriggerInfo *tginfo)
for (findx = 0; findx < tginfo->tgnargs; findx++)
{
/* find the embedded null that terminates this trigger argument */
- size_t tlen = strlen(p);
+ size_t tlen = strlen(p);
if (p + tlen >= tgargs + lentgargs)
{
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index e71d03604b7..c309f69f726 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.163 2010/02/18 01:29:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.164 2010/02/26 02:01:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -338,7 +338,7 @@ typedef struct _triggerInfo
* to sort them the way we want.
*
* Note: condeferrable and condeferred are currently only valid for
- * unique/primary-key constraints. Otherwise that info is in condef.
+ * unique/primary-key constraints. Otherwise that info is in condef.
*/
typedef struct _constraintInfo
{
@@ -439,13 +439,13 @@ typedef struct _defaultACLInfo
{
DumpableObject dobj;
char *defaclrole;
- char defaclobjtype;
+ char defaclobjtype;
char *defaclacl;
} DefaultACLInfo;
typedef struct _blobInfo
{
- DumpableObject dobj;
+ DumpableObject dobj;
char *rolname;
char *blobacl;
} BlobInfo;
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c
index f3761217d1c..0c1efcdeb3e 100644
--- a/src/bin/pg_dump/pg_dump_sort.c
+++ b/src/bin/pg_dump/pg_dump_sort.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump_sort.c,v 1.29 2010/02/18 01:29:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump_sort.c,v 1.30 2010/02/26 02:01:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -164,10 +164,10 @@ DOTypeNameCompare(const void *p1, const void *p2)
return cmpval;
/* To have a stable sort order, break ties for some object types */
- if (obj1->objType == DO_FUNC || obj1->objType == DO_AGG)
+ if (obj1->objType == DO_FUNC || obj1->objType == DO_AGG)
{
- FuncInfo *fobj1 = *(FuncInfo **) p1;
- FuncInfo *fobj2 = *(FuncInfo **) p2;
+ FuncInfo *fobj1 = *(FuncInfo **) p1;
+ FuncInfo *fobj2 = *(FuncInfo **) p2;
cmpval = fobj1->nargs - fobj2->nargs;
if (cmpval != 0)
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 53a1e25d7ad..275a22ab88d 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.133 2010/02/17 04:19:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.134 2010/02/26 02:01:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1397,7 +1397,7 @@ dumpUserConfig(PGconn *conn, const char *username)
if (server_version >= 90000)
printfPQExpBuffer(buf, "SELECT setconfig[%d] FROM pg_db_role_setting WHERE "
"setdatabase = 0 AND setrole = "
- "(SELECT oid FROM pg_authid WHERE rolname = ", count);
+ "(SELECT oid FROM pg_authid WHERE rolname = ", count);
else if (server_version >= 80100)
printfPQExpBuffer(buf, "SELECT rolconfig[%d] FROM pg_authid WHERE rolname = ", count);
else
@@ -1432,13 +1432,13 @@ dumpUserConfig(PGconn *conn, const char *username)
static void
dumpDbRoleConfig(PGconn *conn)
{
- PQExpBuffer buf = createPQExpBuffer();
+ PQExpBuffer buf = createPQExpBuffer();
PGresult *res;
int i;
printfPQExpBuffer(buf, "SELECT rolname, datname, unnest(setconfig) "
"FROM pg_db_role_setting, pg_authid, pg_database "
- "WHERE setrole = pg_authid.oid AND setdatabase = pg_database.oid");
+ "WHERE setrole = pg_authid.oid AND setdatabase = pg_database.oid");
res = executeQuery(conn, buf->data);
if (PQntuples(res) > 0)
@@ -1628,20 +1628,20 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
exit(1);
}
- keywords[0] = "host";
- values[0] = pghost;
- keywords[1] = "port";
- values[1] = pgport;
- keywords[2] = "user";
- values[2] = pguser;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "host";
+ values[0] = pghost;
+ keywords[1] = "port";
+ values[1] = pgport;
+ keywords[2] = "user";
+ values[2] = pguser;
+ keywords[3] = "password";
+ values[3] = password;
+ keywords[4] = "dbname";
+ values[4] = dbname;
+ keywords[5] = "fallback_application_name";
+ values[5] = progname;
+ keywords[6] = NULL;
+ values[6] = NULL;
new_pass = false;
conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c
index 07ea5fd13bc..d14df9cec8b 100644
--- a/src/bin/pg_resetxlog/pg_resetxlog.c
+++ b/src/bin/pg_resetxlog/pg_resetxlog.c
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.77 2010/01/04 12:50:49 heikki Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.78 2010/02/26 02:01:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -312,10 +312,10 @@ main(int argc, char *argv[])
/*
* For the moment, just set oldestXid to a value that will force
- * immediate autovacuum-for-wraparound. It's not clear whether
- * adding user control of this is useful, so let's just do something
- * that's reasonably safe. The magic constant here corresponds to
- * the maximum allowed value of autovacuum_freeze_max_age.
+ * immediate autovacuum-for-wraparound. It's not clear whether adding
+ * user control of this is useful, so let's just do something that's
+ * reasonably safe. The magic constant here corresponds to the
+ * maximum allowed value of autovacuum_freeze_max_age.
*/
ControlFile.checkPointCopy.oldestXid = set_xid - 2000000000;
if (ControlFile.checkPointCopy.oldestXid < FirstNormalTransactionId)
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 54566c818f2..e9476c4f3fc 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.215 2010/02/16 21:07:01 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.216 2010/02/26 02:01:17 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@@ -418,7 +418,7 @@ exec_command(const char *cmd,
if (pattern)
pattern2 = psql_scan_slash_option(scan_state,
- OT_NORMAL, NULL, true);
+ OT_NORMAL, NULL, true);
success = listDbRoleSettings(pattern, pattern2);
}
else
@@ -1259,20 +1259,20 @@ do_connect(char *dbname, char *user, char *host, char *port)
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "host";
+ values[0] = host;
+ keywords[1] = "port";
+ values[1] = port;
+ keywords[2] = "user";
+ values[2] = user;
+ keywords[3] = "password";
+ values[3] = password;
+ keywords[4] = "dbname";
+ values[4] = dbname;
+ keywords[5] = "fallback_application_name";
+ values[5] = pset.progname;
+ keywords[6] = NULL;
+ values[6] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
@@ -1331,7 +1331,7 @@ do_connect(char *dbname, char *user, char *host, char *port)
PQsetNoticeProcessor(n_conn, NoticeProcessor, NULL);
pset.db = n_conn;
SyncVariables();
- connection_warnings(false); /* Must be after SyncVariables */
+ connection_warnings(false); /* Must be after SyncVariables */
/* Tell the user about the new connection */
if (!pset.quiet)
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 6a6517d0032..e9e7c37c65e 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -8,7 +8,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.237 2010/02/17 04:19:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.238 2010/02/26 02:01:18 momjian Exp $
*/
#include "postgres_fe.h"
@@ -755,7 +755,7 @@ listDefaultACLs(const char *pattern)
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
- "SELECT pg_catalog.pg_get_userbyid(d.defaclrole) AS \"%s\",\n"
+ "SELECT pg_catalog.pg_get_userbyid(d.defaclrole) AS \"%s\",\n"
" n.nspname AS \"%s\",\n"
" CASE d.defaclobjtype WHEN 'r' THEN '%s' WHEN 'S' THEN '%s' WHEN 'f' THEN '%s' END AS \"%s\",\n"
" ",
@@ -769,7 +769,7 @@ listDefaultACLs(const char *pattern)
printACLColumn(&buf, "d.defaclacl");
appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_default_acl d\n"
- " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.defaclnamespace\n");
+ " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.defaclnamespace\n");
processSQLNamePattern(pset.db, &buf, pattern, false, false,
NULL,
@@ -1388,7 +1388,7 @@ describeOneTableDetails(const char *schemaname,
if (verbose)
{
int firstvcol = (tableinfo.relkind == 'i' ? 6 : 5);
- char *storage = PQgetvalue(res, i, firstvcol);
+ char *storage = PQgetvalue(res, i, firstvcol);
/* these strings are literal in our syntax, so not translated. */
printTableAddCell(&cont, (storage[0] == 'p' ? "plain" :
@@ -1418,7 +1418,7 @@ describeOneTableDetails(const char *schemaname,
" (NOT i.indimmediate) AND "
"EXISTS (SELECT 1 FROM pg_catalog.pg_depend d, "
"pg_catalog.pg_constraint con WHERE "
- "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
+ "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
"d.objid = i.indexrelid AND "
"d.refclassid = 'pg_catalog.pg_constraint'::pg_catalog.regclass AND "
"d.refobjid = con.oid AND d.deptype = 'i' AND "
@@ -1426,7 +1426,7 @@ describeOneTableDetails(const char *schemaname,
" (NOT i.indimmediate) AND "
"EXISTS (SELECT 1 FROM pg_catalog.pg_depend d, "
"pg_catalog.pg_constraint con WHERE "
- "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
+ "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
"d.objid = i.indexrelid AND "
"d.refclassid = 'pg_catalog.pg_constraint'::pg_catalog.regclass AND "
"d.refobjid = con.oid AND d.deptype = 'i' AND "
@@ -1435,7 +1435,7 @@ describeOneTableDetails(const char *schemaname,
appendPQExpBuffer(&buf,
" false AS condeferrable, false AS condeferred,\n");
appendPQExpBuffer(&buf, " a.amname, c2.relname, "
- "pg_catalog.pg_get_expr(i.indpred, i.indrelid, true)\n"
+ "pg_catalog.pg_get_expr(i.indpred, i.indrelid, true)\n"
"FROM pg_catalog.pg_index i, pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
"WHERE i.indexrelid = c.oid AND c.oid = '%s' AND c.relam = a.oid\n"
"AND i.indrelid = c2.oid",
@@ -1551,22 +1551,22 @@ describeOneTableDetails(const char *schemaname,
appendPQExpBuffer(&buf, "pg_catalog.pg_get_indexdef(i.indexrelid, 0, true)");
if (pset.sversion >= 90000)
appendPQExpBuffer(&buf,
- ",\n (NOT i.indimmediate) AND "
- "EXISTS (SELECT 1 FROM pg_catalog.pg_depend d, "
- "pg_catalog.pg_constraint con WHERE "
- "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
- "d.objid = i.indexrelid AND "
- "d.refclassid = 'pg_catalog.pg_constraint'::pg_catalog.regclass AND "
+ ",\n (NOT i.indimmediate) AND "
+ "EXISTS (SELECT 1 FROM pg_catalog.pg_depend d, "
+ "pg_catalog.pg_constraint con WHERE "
+ "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
+ "d.objid = i.indexrelid AND "
+ "d.refclassid = 'pg_catalog.pg_constraint'::pg_catalog.regclass AND "
"d.refobjid = con.oid AND d.deptype = 'i' AND "
- "con.condeferrable) AS condeferrable"
- ",\n (NOT i.indimmediate) AND "
- "EXISTS (SELECT 1 FROM pg_catalog.pg_depend d, "
- "pg_catalog.pg_constraint con WHERE "
- "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
- "d.objid = i.indexrelid AND "
- "d.refclassid = 'pg_catalog.pg_constraint'::pg_catalog.regclass AND "
+ "con.condeferrable) AS condeferrable"
+ ",\n (NOT i.indimmediate) AND "
+ "EXISTS (SELECT 1 FROM pg_catalog.pg_depend d, "
+ "pg_catalog.pg_constraint con WHERE "
+ "d.classid = 'pg_catalog.pg_class'::pg_catalog.regclass AND "
+ "d.objid = i.indexrelid AND "
+ "d.refclassid = 'pg_catalog.pg_constraint'::pg_catalog.regclass AND "
"d.refobjid = con.oid AND d.deptype = 'i' AND "
- "con.condeferred) AS condeferred");
+ "con.condeferred) AS condeferred");
else
appendPQExpBuffer(&buf, ", false AS condeferrable, false AS condeferred");
if (pset.sversion >= 80000)
@@ -2313,23 +2313,23 @@ add_role_attribute(PQExpBuffer buf, const char *const str)
bool
listDbRoleSettings(const char *pattern, const char *pattern2)
{
- PQExpBufferData buf;
- PGresult *res;
+ PQExpBufferData buf;
+ PGresult *res;
printQueryOpt myopt = pset.popt;
initPQExpBuffer(&buf);
if (pset.sversion >= 90000)
{
- bool havewhere;
+ bool havewhere;
printfPQExpBuffer(&buf, "SELECT rolname AS role, datname AS database,\n"
- "pg_catalog.array_to_string(setconfig, E'\\n') AS settings\n"
+ "pg_catalog.array_to_string(setconfig, E'\\n') AS settings\n"
"FROM pg_db_role_setting AS s\n"
- "LEFT JOIN pg_database ON pg_database.oid = setdatabase\n"
+ "LEFT JOIN pg_database ON pg_database.oid = setdatabase\n"
"LEFT JOIN pg_roles ON pg_roles.oid = setrole\n");
havewhere = processSQLNamePattern(pset.db, &buf, pattern, false, false,
- NULL, "pg_roles.rolname", NULL, NULL);
+ NULL, "pg_roles.rolname", NULL, NULL);
processSQLNamePattern(pset.db, &buf, pattern2, havewhere, false,
NULL, "pg_database.datname", NULL, NULL);
appendPQExpBufferStr(&buf, "ORDER BY role, database");
@@ -2337,7 +2337,7 @@ listDbRoleSettings(const char *pattern, const char *pattern2)
else
{
fprintf(pset.queryFout,
- _("No per-database role settings support in this server version.\n"));
+ _("No per-database role settings support in this server version.\n"));
return false;
}
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 70abc29d803..d28fe9c0ba4 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.68 2010/01/02 16:57:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.69 2010/02/26 02:01:18 momjian Exp $
*/
#include "postgres_fe.h"
@@ -357,8 +357,8 @@ saveHistory(char *fname, int max_lines, bool appendFlag, bool encodeFlag)
* On newer versions of libreadline, truncate the history file as
* needed and then append what we've added. This avoids overwriting
* history from other concurrent sessions (although there are still
- * race conditions when two sessions exit at about the same time).
- * If we don't have those functions, fall back to write_history().
+ * race conditions when two sessions exit at about the same time). If
+ * we don't have those functions, fall back to write_history().
*
* Note: return value of write_history is not standardized across GNU
* readline and libedit. Therefore, check for errno becoming set to
@@ -367,8 +367,8 @@ saveHistory(char *fname, int max_lines, bool appendFlag, bool encodeFlag)
#if defined(HAVE_HISTORY_TRUNCATE_FILE) && defined(HAVE_APPEND_HISTORY)
if (appendFlag)
{
- int nlines;
- int fd;
+ int nlines;
+ int fd;
/* truncate previous entries if needed */
if (max_lines >= 0)
@@ -396,7 +396,7 @@ saveHistory(char *fname, int max_lines, bool appendFlag, bool encodeFlag)
/* truncate what we have ... */
if (max_lines >= 0)
stifle_history(max_lines);
- /* ... and overwrite file. Tough luck for concurrent sessions. */
+ /* ... and overwrite file. Tough luck for concurrent sessions. */
errno = 0;
(void) write_history(fname);
if (errno == 0)
diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h
index 8577563d9e7..170590645b0 100644
--- a/src/bin/psql/input.h
+++ b/src/bin/psql/input.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.34 2010/01/02 16:57:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.35 2010/02/26 02:01:19 momjian Exp $
*/
#ifndef INPUT_H
#define INPUT_H
@@ -22,21 +22,18 @@
#if defined(HAVE_READLINE_HISTORY_H)
#include <readline/history.h>
#endif
-
#elif defined(HAVE_EDITLINE_READLINE_H)
#include <editline/readline.h>
#if defined(HAVE_EDITLINE_HISTORY_H)
#include <editline/history.h>
#endif
-
#elif defined(HAVE_READLINE_H)
#include <readline.h>
#if defined(HAVE_HISTORY_H)
#include <history.h>
#endif
-
-#endif /* HAVE_READLINE_READLINE_H, etc */
-#endif /* HAVE_LIBREADLINE */
+#endif /* HAVE_READLINE_READLINE_H, etc */
+#endif /* HAVE_LIBREADLINE */
#include "pqexpbuffer.h"
diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c
index a83039d353c..b915c9f9e5d 100644
--- a/src/bin/psql/large_obj.c
+++ b/src/bin/psql/large_obj.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.55 2010/02/17 04:19:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.56 2010/02/26 02:01:19 momjian Exp $
*/
#include "postgres_fe.h"
#include "large_obj.h"
@@ -283,7 +283,7 @@ do_lo_list(void)
snprintf(buf, sizeof(buf),
"SELECT oid as \"%s\",\n"
" pg_catalog.pg_get_userbyid(lomowner) as \"%s\",\n"
- " pg_catalog.obj_description(oid, 'pg_largeobject') as \"%s\"\n"
+ " pg_catalog.obj_description(oid, 'pg_largeobject') as \"%s\"\n"
" FROM pg_catalog.pg_largeobject_metadata "
" ORDER BY oid",
gettext_noop("ID"),
@@ -294,8 +294,8 @@ do_lo_list(void)
{
snprintf(buf, sizeof(buf),
"SELECT loid as \"%s\",\n"
- " pg_catalog.obj_description(loid, 'pg_largeobject') as \"%s\"\n"
- "FROM (SELECT DISTINCT loid FROM pg_catalog.pg_largeobject) x\n"
+ " pg_catalog.obj_description(loid, 'pg_largeobject') as \"%s\"\n"
+ "FROM (SELECT DISTINCT loid FROM pg_catalog.pg_largeobject) x\n"
"ORDER BY 1",
gettext_noop("ID"),
gettext_noop("Description"));
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index 4088c181978..23904f3f454 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.98 2010/01/02 16:57:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.99 2010/02/26 02:01:19 momjian Exp $
*/
#include "postgres_fe.h"
#include "mainloop.h"
@@ -419,7 +419,7 @@ MainLoop(FILE *source)
* psqlscan.c is #include'd here instead of being compiled on its own.
* This is because we need postgres_fe.h to be read before any system
* include files, else things tend to break on platforms that have
- * multiple infrastructures for stdio.h and so on. flex is absolutely
+ * multiple infrastructures for stdio.h and so on. flex is absolutely
* uncooperative about that, so we can't compile psqlscan.c on its own.
*/
#include "psqlscan.c"
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index fc29cfd90d7..f6acc466dc1 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.121 2010/01/30 18:59:51 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.122 2010/02/26 02:01:19 momjian Exp $
*/
#include "postgres_fe.h"
@@ -49,10 +49,10 @@ const printTextFormat pg_asciiformat =
{
"ascii",
{
- { "-", "+", "+", "+" },
- { "-", "+", "+", "+" },
- { "-", "+", "+", "+" },
- { "", "|", "|", "|" }
+ {"-", "+", "+", "+"},
+ {"-", "+", "+", "+"},
+ {"-", "+", "+", "+"},
+ {"", "|", "|", "|"}
},
"|",
"|",
@@ -70,10 +70,10 @@ const printTextFormat pg_asciiformat_old =
{
"old-ascii",
{
- { "-", "+", "+", "+" },
- { "-", "+", "+", "+" },
- { "-", "+", "+", "+" },
- { "", "|", "|", "|" }
+ {"-", "+", "+", "+"},
+ {"-", "+", "+", "+"},
+ {"-", "+", "+", "+"},
+ {"", "|", "|", "|"}
},
":",
";",
@@ -92,13 +92,13 @@ const printTextFormat pg_utf8format =
"unicode",
{
/* ─, ┌, ┬, ┐ */
- { "\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220" },
+ {"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
/* ─, ├, ┼, ┤ */
- { "\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244" },
+ {"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
/* ─, └, ┴, ┘ */
- { "\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230" },
+ {"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
/* N/A, │, │, │ */
- { "", "\342\224\202", "\342\224\202", "\342\224\202" }
+ {"", "\342\224\202", "\342\224\202", "\342\224\202"}
},
/* │ */
"\342\224\202",
@@ -989,11 +989,11 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
* If left-aligned, pad out remaining space if needed (not
* last column, and/or wrap marks required).
*/
- if (cont->aligns[j] != 'r') /* Left aligned cell */
+ if (cont->aligns[j] != 'r') /* Left aligned cell */
{
if (finalspaces ||
wrap[j] == PRINT_LINE_WRAP_WRAP ||
- wrap[j] == PRINT_LINE_WRAP_NEWLINE)
+ wrap[j] == PRINT_LINE_WRAP_NEWLINE)
fprintf(fout, "%*s",
width_wrap[j] - chars_to_output, "");
}
@@ -1009,9 +1009,9 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
/* Print column divider, if not the last column */
if (opt_border != 0 && j < col_count - 1)
{
- if (wrap[j+1] == PRINT_LINE_WRAP_WRAP)
+ if (wrap[j + 1] == PRINT_LINE_WRAP_WRAP)
fputs(format->midvrule_wrap, fout);
- else if (wrap[j+1] == PRINT_LINE_WRAP_NEWLINE)
+ else if (wrap[j + 1] == PRINT_LINE_WRAP_NEWLINE)
fputs(format->midvrule_nl, fout);
else if (col_lineptrs[j + 1][curr_nl_line[j + 1]].ptr == NULL)
fputs(format->midvrule_blank, fout);
@@ -1080,9 +1080,9 @@ print_aligned_vertical_line(const printTableContent *cont,
{
const printTextFormat *format = get_line_style(cont->opt);
const printTextLineFormat *lformat = &format->lrule[pos];
- unsigned short opt_border = cont->opt->border;
- unsigned int i;
- int reclen = 0;
+ unsigned short opt_border = cont->opt->border;
+ unsigned int i;
+ int reclen = 0;
if (opt_border == 2)
fprintf(fout, "%s%s", lformat->leftvrule, lformat->hrule);
@@ -1231,8 +1231,8 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
break;
if (i == 0)
- pos = PRINT_RULE_TOP;
- else if (!(*(ptr+1)))
+ pos = PRINT_RULE_TOP;
+ else if (!(*(ptr + 1)))
pos = PRINT_RULE_BOTTOM;
else
pos = PRINT_RULE_MIDDLE;
@@ -2555,8 +2555,8 @@ const printTextFormat *
get_line_style(const printTableOpt *opt)
{
/*
- * Note: this function mainly exists to preserve the convention that
- * a printTableOpt struct can be initialized to zeroes to get default
+ * Note: this function mainly exists to preserve the convention that a
+ * printTableOpt struct can be initialized to zeroes to get default
* behavior.
*/
if (opt->line_style != NULL)
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index a2b430c57ff..9df6146d5ba 100644
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.43 2010/01/02 16:57:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.44 2010/02/26 02:01:19 momjian Exp $
*/
#ifndef PRINT_H
#define PRINT_H
@@ -52,19 +52,19 @@ typedef enum printTextLineWrap
typedef struct printTextFormat
{
/* A complete line style */
- const char *name; /* for display purposes */
- printTextLineFormat lrule[4]; /* indexed by enum printTextRule */
+ const char *name; /* for display purposes */
+ printTextLineFormat lrule[4]; /* indexed by enum printTextRule */
const char *midvrule_nl; /* vertical line for continue after newline */
const char *midvrule_wrap; /* vertical line for wrapped data */
- const char *midvrule_blank; /* vertical line for blank data */
- const char *header_nl_left; /* left mark after newline */
- const char *header_nl_right; /* right mark for newline */
+ const char *midvrule_blank; /* vertical line for blank data */
+ const char *header_nl_left; /* left mark after newline */
+ const char *header_nl_right; /* right mark for newline */
const char *nl_left; /* left mark after newline */
const char *nl_right; /* right mark for newline */
const char *wrap_left; /* left mark after wrapped data */
const char *wrap_right; /* right mark for wrapped data */
- bool wrap_right_border; /* use right-hand border for wrap marks
- * when border=0? */
+ bool wrap_right_border; /* use right-hand border for wrap
+ * marks when border=0? */
} printTextFormat;
typedef struct printTableOpt
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 3f497023945..c34de5cd8cb 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.161 2010/02/16 21:07:01 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.162 2010/02/26 02:01:19 momjian Exp $
*/
#include "postgres_fe.h"
@@ -175,22 +175,22 @@ main(int argc, char *argv[])
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
- keywords[0] = "host";
- values[0] = options.host;
- keywords[1] = "port";
- values[1] = options.port;
- keywords[2] = "user";
- values[2] = options.username;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = (options.action == ACT_LIST_DB &&
- options.dbname == NULL) ?
- "postgres" : options.dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "host";
+ values[0] = options.host;
+ keywords[1] = "port";
+ values[1] = options.port;
+ keywords[2] = "user";
+ values[2] = options.username;
+ keywords[3] = "password";
+ values[3] = password;
+ keywords[4] = "dbname";
+ values[4] = (options.action == ACT_LIST_DB &&
+ options.dbname == NULL) ?
+ "postgres" : options.dbname;
+ keywords[5] = "fallback_application_name";
+ values[5] = pset.progname;
+ keywords[6] = NULL;
+ values[6] = NULL;
new_pass = false;
pset.db = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index b3dbfb20217..38882096a26 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.195 2010/02/17 04:09:40 itagaki Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.196 2010/02/26 02:01:20 momjian Exp $
*/
/*----------------------------------------------------------------------
@@ -1437,7 +1437,7 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp(prev2_wd, "ON") == 0)
{
static const char *const list_CREATE_INDEX2[] =
- {"(", "USING", NULL};
+ {"(", "USING", NULL};
COMPLETE_WITH_LIST(list_CREATE_INDEX2);
}
@@ -1577,7 +1577,11 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_LIST(list_CREATETRIGGER2);
}
- /* complete CREATE TRIGGER <name> BEFORE,AFTER event ON with a list of tables */
+
+ /*
+ * complete CREATE TRIGGER <name> BEFORE,AFTER event ON with a list of
+ * tables
+ */
else if (pg_strcasecmp(prev5_wd, "TRIGGER") == 0 &&
(pg_strcasecmp(prev3_wd, "BEFORE") == 0 ||
pg_strcasecmp(prev3_wd, "AFTER") == 0) &&
@@ -1692,6 +1696,7 @@ psql_completion(char *text, int start, int end)
}
/* DO */
+
/*
* Complete DO with LANGUAGE.
*/
@@ -1966,8 +1971,8 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_ATTR(prev2_wd, "");
/*
- * Complete INSERT INTO <table> with "(" or "VALUES" or "SELECT" or "TABLE"
- * or "DEFAULT VALUES"
+ * Complete INSERT INTO <table> with "(" or "VALUES" or "SELECT" or
+ * "TABLE" or "DEFAULT VALUES"
*/
else if (pg_strcasecmp(prev3_wd, "INSERT") == 0 &&
pg_strcasecmp(prev2_wd, "INTO") == 0)
@@ -2452,8 +2457,8 @@ psql_completion(char *text, int start, int end)
{
static const char *const my_list[] =
{"format", "border", "expanded",
- "null", "fieldsep", "tuples_only", "title", "tableattr",
- "linestyle", "pager", "recordsep", NULL};
+ "null", "fieldsep", "tuples_only", "title", "tableattr",
+ "linestyle", "pager", "recordsep", NULL};
COMPLETE_WITH_LIST(my_list);
}
@@ -2955,7 +2960,7 @@ previous_word(int point, int skip)
while (skip-- >= 0)
{
- int parentheses = 0;
+ int parentheses = 0;
/* now find the first non-space which then constitutes the end */
for (i = point; i >= 0; i--)
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index 026eb80a025..fc5a325dbd5 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.39 2010/02/05 03:09:05 joe Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.40 2010/02/26 02:01:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,20 +118,20 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
exit(1);
}
- keywords[0] = "host";
- values[0] = pghost;
- keywords[1] = "port";
- values[1] = pgport;
- keywords[2] = "user";
- values[2] = pguser;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "host";
+ values[0] = pghost;
+ keywords[1] = "port";
+ values[1] = pgport;
+ keywords[2] = "user";
+ values[2] = pguser;
+ keywords[3] = "password";
+ values[3] = password;
+ keywords[4] = "dbname";
+ values[4] = dbname;
+ keywords[5] = "fallback_application_name";
+ values[5] = progname;
+ keywords[6] = NULL;
+ values[6] = NULL;
new_pass = false;
conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/scripts/droplang.c b/src/bin/scripts/droplang.c
index 5b1fd81c6c2..b634506f0fb 100644
--- a/src/bin/scripts/droplang.c
+++ b/src/bin/scripts/droplang.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/droplang.c,v 1.33 2010/01/02 16:58:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/droplang.c,v 1.34 2010/02/26 02:01:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -190,8 +190,8 @@ main(int argc, char *argv[])
executeCommand(conn, "SET search_path = pg_catalog;", progname, echo);
/*
- * Make sure the language is installed and find the OIDs of the
- * language support functions
+ * Make sure the language is installed and find the OIDs of the language
+ * support functions
*/
printfPQExpBuffer(&sql, "SELECT lanplcallfoid, laninline, lanvalidator "
"FROM pg_language WHERE lanname = '%s' AND lanispl;",
@@ -277,7 +277,7 @@ main(int argc, char *argv[])
PQclear(result);
}
else
- keepinline = true; /* don't try to delete it */
+ keepinline = true; /* don't try to delete it */
/*
* Find the inline handler name
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index af1dc8c397d..21abfedae71 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.35 2010/02/17 04:19:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.36 2010/02/26 02:01:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -313,7 +313,7 @@ vacuum_all_databases(bool full, bool verbose, bool and_analyze, bool analyze_onl
}
vacuum_one_database(dbname, full, verbose, and_analyze, analyze_only,
- freeze, NULL, host, port, username, prompt_password,
+ freeze, NULL, host, port, username, prompt_password,
progname, echo);
}