summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2012-06-10 15:20:04 -0400
committerBruce Momjian <bruce@momjian.us>2012-06-10 15:20:04 -0400
commit927d61eeff78363ea3938c818d07e511ebaf75cf (patch)
tree2f0bcecf53327f76272a8ce690fa62505520fab9 /src/bin
parent60801944fa105252b48ea5688d47dfc05c695042 (diff)
downloadpostgresql-927d61eeff78363ea3938c818d07e511ebaf75cf.tar.gz
Run pgindent on 9.2 source tree in preparation for first 9.3
commit-fest.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/initdb/findtimezone.c3
-rw-r--r--src/bin/initdb/initdb.c41
-rw-r--r--src/bin/pg_basebackup/pg_basebackup.c9
-rw-r--r--src/bin/pg_basebackup/pg_receivexlog.c13
-rw-r--r--src/bin/pg_basebackup/receivelog.c25
-rw-r--r--src/bin/pg_basebackup/receivelog.h16
-rw-r--r--src/bin/pg_basebackup/streamutil.c4
-rw-r--r--src/bin/pg_ctl/pg_ctl.c17
-rw-r--r--src/bin/pg_dump/common.c4
-rw-r--r--src/bin/pg_dump/dumputils.c28
-rw-r--r--src/bin/pg_dump/dumputils.h15
-rw-r--r--src/bin/pg_dump/pg_backup.h2
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c47
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h2
-rw-r--r--src/bin/pg_dump/pg_backup_custom.c8
-rw-r--r--src/bin/pg_dump/pg_backup_db.c14
-rw-r--r--src/bin/pg_dump/pg_backup_directory.c14
-rw-r--r--src/bin/pg_dump/pg_backup_tar.c12
-rw-r--r--src/bin/pg_dump/pg_dump.c96
-rw-r--r--src/bin/pg_dump/pg_dump_sort.c28
-rw-r--r--src/bin/pg_dump/pg_dumpall.c6
-rw-r--r--src/bin/pgevent/pgevent.c2
-rw-r--r--src/bin/psql/command.c27
-rw-r--r--src/bin/psql/common.c9
-rw-r--r--src/bin/psql/copy.c5
-rw-r--r--src/bin/psql/describe.c48
-rw-r--r--src/bin/psql/help.c6
-rw-r--r--src/bin/psql/input.c3
-rw-r--r--src/bin/psql/print.c7
-rw-r--r--src/bin/psql/print.h6
-rw-r--r--src/bin/psql/startup.c7
-rw-r--r--src/bin/psql/stringutils.c4
-rw-r--r--src/bin/psql/tab-complete.c50
-rw-r--r--src/bin/psql/variables.c2
-rw-r--r--src/bin/scripts/clusterdb.c6
-rw-r--r--src/bin/scripts/common.c2
-rw-r--r--src/bin/scripts/common.h8
-rw-r--r--src/bin/scripts/createlang.c7
-rw-r--r--src/bin/scripts/dropdb.c4
-rw-r--r--src/bin/scripts/droplang.c7
-rw-r--r--src/bin/scripts/reindexdb.c6
-rw-r--r--src/bin/scripts/vacuumdb.c10
42 files changed, 333 insertions, 297 deletions
diff --git a/src/bin/initdb/findtimezone.c b/src/bin/initdb/findtimezone.c
index 1ebad182b2..6d6f96add0 100644
--- a/src/bin/initdb/findtimezone.c
+++ b/src/bin/initdb/findtimezone.c
@@ -52,7 +52,7 @@ pg_TZDIR(void)
* This is simpler than the backend function of the same name because
* we assume that the input string has the correct case already, so there
* is no need for case-folding. (This is obviously true if we got the file
- * name from the filesystem to start with. The only other place it can come
+ * name from the filesystem to start with. The only other place it can come
* from is the environment variable TZ, and there seems no need to allow
* case variation in that; other programs aren't likely to.)
*
@@ -571,7 +571,6 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry * tt,
pgfnames_cleanup(names);
}
-
#else /* WIN32 */
static const struct
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 2707334dd5..3789948cdf 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -66,32 +66,32 @@ extern const char *select_default_timezone(const char *share_path);
static const char *auth_methods_host[] = {"trust", "reject", "md5", "password", "ident", "radius",
#ifdef ENABLE_GSS
- "gss",
+ "gss",
#endif
#ifdef ENABLE_SSPI
- "sspi",
+ "sspi",
#endif
#ifdef KRB5
- "krb5",
+ "krb5",
#endif
#ifdef USE_PAM
- "pam", "pam ",
+ "pam", "pam ",
#endif
#ifdef USE_LDAP
- "ldap",
+ "ldap",
#endif
#ifdef USE_SSL
- "cert",
+ "cert",
#endif
- NULL};
+NULL};
static const char *auth_methods_local[] = {"trust", "reject", "md5", "password", "peer", "radius",
#ifdef USE_PAM
- "pam", "pam ",
+ "pam", "pam ",
#endif
#ifdef USE_LDAP
- "ldap",
+ "ldap",
#endif
- NULL};
+NULL};
/*
* these values are passed in by makefile defines
@@ -214,7 +214,7 @@ static void check_ok(void);
static char *escape_quotes(const char *src);
static int locale_date_order(const char *locale);
static bool check_locale_name(int category, const char *locale,
- char **canonname);
+ char **canonname);
static bool check_locale_encoding(const char *locale, int encoding);
static void setlocales(void);
static void usage(const char *progname);
@@ -2244,7 +2244,7 @@ locale_date_order(const char *locale)
* Is the locale name valid for the locale category?
*
* If successful, and canonname isn't NULL, a malloc'd copy of the locale's
- * canonical name is stored there. This is especially useful for figuring out
+ * canonical name is stored there. This is especially useful for figuring out
* what locale name "" means (ie, the environment value). (Actually,
* it seems that on most implementations that's the only thing it's good for;
* we could wish that setlocale gave back a canonically spelled version of
@@ -2548,7 +2548,7 @@ check_authmethod_unspecified(const char **authmethod)
{
authwarning = _("\nWARNING: enabling \"trust\" authentication for local connections\n"
"You can change this by editing pg_hba.conf or using the option -A, or\n"
- "--auth-local and --auth-host, the next time you run initdb.\n");
+ "--auth-local and --auth-host, the next time you run initdb.\n");
*authmethod = "trust";
}
}
@@ -2676,6 +2676,7 @@ main(int argc, char *argv[])
{
case 'A':
authmethodlocal = authmethodhost = xstrdup(optarg);
+
/*
* When ident is specified, use peer for local connections.
* Mirrored, when peer is specified, use ident for TCP/IP
@@ -2760,9 +2761,9 @@ main(int argc, char *argv[])
}
- /*
- * Non-option argument specifies data directory
- * as long as it wasn't already specified with -D / --pgdata
+ /*
+ * Non-option argument specifies data directory as long as it wasn't
+ * already specified with -D / --pgdata
*/
if (optind < argc && strlen(pg_data) == 0)
{
@@ -3017,18 +3018,18 @@ main(int argc, char *argv[])
*/
#ifdef WIN32
printf(_("Encoding \"%s\" implied by locale is not allowed as a server-side encoding.\n"
- "The default database encoding will be set to \"%s\" instead.\n"),
+ "The default database encoding will be set to \"%s\" instead.\n"),
pg_encoding_to_char(ctype_enc),
pg_encoding_to_char(PG_UTF8));
ctype_enc = PG_UTF8;
encodingid = encodingid_to_string(ctype_enc);
#else
fprintf(stderr,
- _("%s: locale \"%s\" requires unsupported encoding \"%s\"\n"),
+ _("%s: locale \"%s\" requires unsupported encoding \"%s\"\n"),
progname, lc_ctype, pg_encoding_to_char(ctype_enc));
fprintf(stderr,
- _("Encoding \"%s\" is not allowed as a server-side encoding.\n"
- "Rerun %s with a different locale selection.\n"),
+ _("Encoding \"%s\" is not allowed as a server-side encoding.\n"
+ "Rerun %s with a different locale selection.\n"),
pg_encoding_to_char(ctype_enc), progname);
exit(1);
#endif
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index c3a0d89897..66a281477a 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -63,6 +63,7 @@ static pid_t bgchild = -1;
/* End position for xlog streaming, empty string if unknown yet */
static XLogRecPtr xlogendptr;
+
#ifndef WIN32
static int has_xlogendptr = 0;
#else
@@ -223,14 +224,14 @@ typedef struct
char xlogdir[MAXPGPATH];
char *sysidentifier;
int timeline;
-} logstreamer_param;
+} logstreamer_param;
static int
-LogStreamerMain(logstreamer_param * param)
+LogStreamerMain(logstreamer_param *param)
{
if (!ReceiveXlogStream(param->bgconn, param->startptr, param->timeline,
param->sysidentifier, param->xlogdir,
- reached_end_position, standby_message_timeout, true))
+ reached_end_position, standby_message_timeout, true))
/*
* Any errors will already have been reported in the function process,
@@ -1092,7 +1093,7 @@ BaseBackup(void)
int status;
int r;
#else
- DWORD status;
+ DWORD status;
#endif
if (verbose)
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index 67a70bcf71..1acb7ccb56 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -92,7 +92,7 @@ stop_streaming(XLogRecPtr segendpos, uint32 timeline, bool segment_finished)
/*
* Determine starting location for streaming, based on:
* 1. If there are existing xlog segments, start at the end of the last one
- * that is complete (size matches XLogSegSize)
+ * that is complete (size matches XLogSegSize)
* 2. If no valid xlog exists, start from the beginning of the current
* WAL segment.
*/
@@ -190,9 +190,10 @@ FindStreamingStart(XLogRecPtr currentpos, uint32 currenttimeline)
if (high_log > 0 || high_seg > 0)
{
XLogRecPtr high_ptr;
+
/*
- * Move the starting pointer to the start of the next segment,
- * since the highest one we've seen was completed.
+ * Move the starting pointer to the start of the next segment, since
+ * the highest one we've seen was completed.
*/
NextLogSeg(high_log, high_seg);
@@ -284,7 +285,6 @@ sigint_handler(int signum)
{
time_to_abort = true;
}
-
#endif
int
@@ -413,9 +413,10 @@ main(int argc, char **argv)
{
StreamLog();
if (time_to_abort)
+
/*
- * We've been Ctrl-C'ed. That's not an error, so exit without
- * an errorcode.
+ * We've been Ctrl-C'ed. That's not an error, so exit without an
+ * errorcode.
*/
exit(0);
else if (noloop)
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index a51a40edfd..9dd94e1140 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -52,7 +52,7 @@ open_walfile(XLogRecPtr startpoint, uint32 timeline, char *basedir, char *namebu
{
int f;
char fn[MAXPGPATH];
- struct stat statbuf;
+ struct stat statbuf;
char *zerobuf;
int bytes;
@@ -80,7 +80,7 @@ open_walfile(XLogRecPtr startpoint, uint32 timeline, char *basedir, char *namebu
return -1;
}
if (statbuf.st_size == XLogSegSize)
- return f; /* File is open and ready to use */
+ return f; /* File is open and ready to use */
if (statbuf.st_size != 0)
{
fprintf(stderr, _("%s: WAL segment %s is %d bytes, should be 0 or %d\n"),
@@ -147,8 +147,8 @@ close_walfile(int walfile, char *basedir, char *walname, bool segment_complete)
}
/*
- * Rename the .partial file only if we've completed writing the
- * whole segment or segment_complete is true.
+ * Rename the .partial file only if we've completed writing the whole
+ * segment or segment_complete is true.
*/
if (currpos == XLOG_SEG_SIZE || segment_complete)
{
@@ -202,7 +202,7 @@ localGetCurrentTimestamp(void)
*/
static void
localTimestampDifference(TimestampTz start_time, TimestampTz stop_time,
- long *secs, int *microsecs)
+ long *secs, int *microsecs)
{
TimestampTz diff = stop_time - start_time;
@@ -229,8 +229,8 @@ localTimestampDifference(TimestampTz start_time, TimestampTz stop_time,
*/
static bool
localTimestampDifferenceExceeds(TimestampTz start_time,
- TimestampTz stop_time,
- int msec)
+ TimestampTz stop_time,
+ int msec)
{
TimestampTz diff = stop_time - start_time;
@@ -392,14 +392,14 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, char *sysi
FD_SET(PQsocket(conn), &input_mask);
if (standby_message_timeout)
{
- TimestampTz targettime;
+ TimestampTz targettime;
targettime = TimestampTzPlusMilliseconds(last_status,
- standby_message_timeout - 1);
+ standby_message_timeout - 1);
localTimestampDifference(now,
targettime,
&timeout.tv_sec,
- (int *)&timeout.tv_usec);
+ (int *) &timeout.tv_usec);
if (timeout.tv_sec <= 0)
timeout.tv_sec = 1; /* Always sleep at least 1 sec */
timeoutptr = &timeout;
@@ -444,9 +444,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, char *sysi
if (copybuf[0] == 'k')
{
/*
- * keepalive message, sent in 9.2 and newer. We just ignore
- * this message completely, but need to skip past it in the
- * stream.
+ * keepalive message, sent in 9.2 and newer. We just ignore this
+ * message completely, but need to skip past it in the stream.
*/
if (r != STREAMING_KEEPALIVE_SIZE)
{
diff --git a/src/bin/pg_basebackup/receivelog.h b/src/bin/pg_basebackup/receivelog.h
index 0a803ee4ac..7176a68bea 100644
--- a/src/bin/pg_basebackup/receivelog.h
+++ b/src/bin/pg_basebackup/receivelog.h
@@ -4,13 +4,13 @@
* Called before trying to read more data or when a segment is
* finished. Return true to stop streaming.
*/
-typedef bool (*stream_stop_callback)(XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
+typedef bool (*stream_stop_callback) (XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
extern bool ReceiveXlogStream(PGconn *conn,
- XLogRecPtr startpos,
- uint32 timeline,
- char *sysidentifier,
- char *basedir,
- stream_stop_callback stream_stop,
- int standby_message_timeout,
- bool rename_partial);
+ XLogRecPtr startpos,
+ uint32 timeline,
+ char *sysidentifier,
+ char *basedir,
+ stream_stop_callback stream_stop,
+ int standby_message_timeout,
+ bool rename_partial);
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 1416faa2e3..1b4a9d240b 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -164,8 +164,8 @@ GetConnection(void)
free(keywords);
/*
- * Ensure we have the same value of integer timestamps as the
- * server we are connecting to.
+ * Ensure we have the same value of integer timestamps as the server
+ * we are connecting to.
*/
tmpparam = PQparameterStatus(tmpconn, "integer_datetimes");
if (!tmpparam)
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 766ba95be1..38828ec914 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -1170,7 +1170,7 @@ do_status(void)
}
}
else
- /* must be a postmaster */
+ /* must be a postmaster */
{
if (postmaster_is_alive((pid_t) pid))
{
@@ -1188,9 +1188,12 @@ do_status(void)
}
}
printf(_("%s: no server running\n"), progname);
+
/*
- * The Linux Standard Base Core Specification 3.1 says this should return '3'
- * http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
+ * The Linux Standard Base Core Specification 3.1 says this should return
+ * '3'
+ * http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-ge
+ * neric/iniscrptact.html
*/
exit(3);
}
@@ -1851,7 +1854,7 @@ set_sig(char *signame)
sig = SIGABRT;
#if 0
/* probably should NOT provide SIGKILL */
- else if (strcmp(signame,"KILL") == 0)
+ else if (strcmp(signame, "KILL") == 0)
sig = SIGKILL;
#endif
else if (strcmp(signame, "TERM") == 0)
@@ -1894,7 +1897,9 @@ set_starttype(char *starttypeopt)
static void
adjust_data_dir(void)
{
- char cmd[MAXPGPATH], filename[MAXPGPATH], *my_exec_path;
+ char cmd[MAXPGPATH],
+ filename[MAXPGPATH],
+ *my_exec_path;
FILE *fd;
/* If there is no postgresql.conf, it can't be a config-only dir */
@@ -2184,7 +2189,7 @@ main(int argc, char **argv)
}
adjust_data_dir();
-
+
if (pg_config == NULL &&
ctl_command != KILL_COMMAND && ctl_command != UNREGISTER_COMMAND)
{
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 42d3645a6d..b02217e81d 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -597,8 +597,8 @@ buildIndexArray(void *objArray, int numObjs, Size objSize)
static int
DOCatalogIdCompare(const void *p1, const void *p2)
{
- const DumpableObject *obj1 = *(DumpableObject * const *) p1;
- const DumpableObject *obj2 = *(DumpableObject * const *) p2;
+ const DumpableObject *obj1 = *(DumpableObject *const *) p1;
+ const DumpableObject *obj2 = *(DumpableObject *const *) p2;
int cmpval;
/*
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index f5d7b5d859..8574380b9c 100644
--- a/src/bin/pg_dump/dumputils.c
+++ b/src/bin/pg_dump/dumputils.c
@@ -33,11 +33,11 @@ const char *progname = NULL;
static struct
{
- on_exit_nicely_callback function;
+ on_exit_nicely_callback function;
void *arg;
-} on_exit_nicely_list[MAX_ON_EXIT_NICELY];
+} on_exit_nicely_list[MAX_ON_EXIT_NICELY];
-static int on_exit_nicely_index;
+static int on_exit_nicely_index;
#define supports_grant_options(version) ((version) >= 70400)
@@ -1221,9 +1221,9 @@ emitShSecLabels(PGconn *conn, PGresult *res, PQExpBuffer buffer,
int i;
for (i = 0; i < PQntuples(res); i++)
- {
- char *provider = PQgetvalue(res, i, 0);
- char *label = PQgetvalue(res, i, 1);
+ {
+ char *provider = PQgetvalue(res, i, 0);
+ char *label = PQgetvalue(res, i, 1);
/* must use fmtId result before calling it again */
appendPQExpBuffer(buffer,
@@ -1233,7 +1233,7 @@ emitShSecLabels(PGconn *conn, PGresult *res, PQExpBuffer buffer,
" %s IS ",
fmtId(objname));
appendStringLiteralConn(buffer, label, conn);
- appendPQExpBuffer(buffer, ";\n");
+ appendPQExpBuffer(buffer, ";\n");
}
}
@@ -1252,11 +1252,11 @@ set_dump_section(const char *arg, int *dumpSections)
if (*dumpSections == DUMP_UNSECTIONED)
*dumpSections = 0;
- if (strcmp(arg,"pre-data") == 0)
+ if (strcmp(arg, "pre-data") == 0)
*dumpSections |= DUMP_PRE_DATA;
- else if (strcmp(arg,"data") == 0)
+ else if (strcmp(arg, "data") == 0)
*dumpSections |= DUMP_DATA;
- else if (strcmp(arg,"post-data") == 0)
+ else if (strcmp(arg, "post-data") == 0)
*dumpSections |= DUMP_POST_DATA;
else
{
@@ -1304,7 +1304,7 @@ vwrite_msg(const char *modulename, const char *fmt, va_list ap)
/*
- * Fail and die, with a message to stderr. Parameters as for write_msg.
+ * Fail and die, with a message to stderr. Parameters as for write_msg.
*/
void
exit_horribly(const char *modulename, const char *fmt,...)
@@ -1336,11 +1336,11 @@ on_exit_nicely(on_exit_nicely_callback function, void *arg)
void
exit_nicely(int code)
{
- int i;
+ int i;
for (i = on_exit_nicely_index - 1; i >= 0; i--)
- (*on_exit_nicely_list[i].function)(code,
- on_exit_nicely_list[i].arg);
+ (*on_exit_nicely_list[i].function) (code,
+ on_exit_nicely_list[i].arg);
#ifdef WIN32
if (parallel_init_done && GetCurrentThreadId() != mainThreadId)
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h
index 3d1ed9570a..4ef8cb3a49 100644
--- a/src/bin/pg_dump/dumputils.h
+++ b/src/bin/pg_dump/dumputils.h
@@ -63,12 +63,15 @@ extern void buildShSecLabelQuery(PGconn *conn, const char *catalog_name,
extern void emitShSecLabels(PGconn *conn, PGresult *res,
PQExpBuffer buffer, const char *target, const char *objname);
extern void set_dump_section(const char *arg, int *dumpSections);
-extern void write_msg(const char *modulename, const char *fmt,...)
- __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
-extern void vwrite_msg(const char *modulename, const char *fmt, va_list ap)
- __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0)));
-extern void exit_horribly(const char *modulename, const char *fmt,...)
- __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3), noreturn));
+extern void
+write_msg(const char *modulename, const char *fmt,...)
+__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
+extern void
+vwrite_msg(const char *modulename, const char *fmt, va_list ap)
+__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0)));
+extern void
+exit_horribly(const char *modulename, const char *fmt,...)
+__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3), noreturn));
extern void on_exit_nicely(on_exit_nicely_callback function, void *arg);
extern void exit_nicely(int code) __attribute__((noreturn));
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index bf7cc1c1ac..3b49395ecb 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -110,7 +110,7 @@ typedef struct _restoreOptions
const char *filename;
int dataOnly;
int schemaOnly;
- int dumpSections;
+ int dumpSections;
int verbose;
int aclsSkip;
int tocSummary;
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index c049becf12..5826bace68 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -95,7 +95,7 @@ typedef struct _parallel_slot
typedef struct ShutdownInformation
{
ParallelState *pstate;
- Archive *AHX;
+ Archive *AHX;
} ShutdownInformation;
static ShutdownInformation shutdown_info;
@@ -529,8 +529,8 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te,
/*
* Ignore DATABASE entry unless we should create it. We must check this
- * here, not in _tocEntryRequired, because the createDB option should
- * not affect emitting a DATABASE entry to an archive file.
+ * here, not in _tocEntryRequired, because the createDB option should not
+ * affect emitting a DATABASE entry to an archive file.
*/
if (!ropt->createDB && strcmp(te->desc, "DATABASE") == 0)
reqs = 0;
@@ -1296,7 +1296,7 @@ RestoreOutput(ArchiveHandle *AH, OutputContext savedContext)
if (res != 0)
exit_horribly(modulename, "could not close output file: %s\n",
- strerror(errno));
+ strerror(errno));
AH->gzOut = savedContext.gzOut;
AH->OF = savedContext.OF;
@@ -1317,8 +1317,8 @@ ahprintf(ArchiveHandle *AH, const char *fmt,...)
/*
* This is paranoid: deal with the possibility that vsnprintf is willing
- * to ignore trailing null or returns > 0 even if string does not fit.
- * It may be the case that it returns cnt = bufsize.
+ * to ignore trailing null or returns > 0 even if string does not fit. It
+ * may be the case that it returns cnt = bufsize.
*/
while (cnt < 0 || cnt >= (bSize - 1))
{
@@ -1456,7 +1456,7 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
res = fwrite(ptr, size, nmemb, AH->OF);
if (res != nmemb)
exit_horribly(modulename, "could not write to output file: %s\n",
- strerror(errno));
+ strerror(errno));
return res;
}
}
@@ -1465,7 +1465,7 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
/* on some error, we may decide to go on... */
void
warn_or_exit_horribly(ArchiveHandle *AH,
- const char *modulename, const char *fmt,...)
+ const char *modulename, const char *fmt,...)
{
va_list ap;
@@ -1549,7 +1549,7 @@ _moveBefore(ArchiveHandle *AH, TocEntry *pos, TocEntry *te)
* items.
*
* The arrays are indexed by dump ID (so entry zero is unused). Note that the
- * array entries run only up to maxDumpId. We might see dependency dump IDs
+ * array entries run only up to maxDumpId. We might see dependency dump IDs
* beyond that (if the dump was partial); so always check the array bound
* before trying to touch an array entry.
*/
@@ -1573,7 +1573,7 @@ buildTocEntryArrays(ArchiveHandle *AH)
/*
* tableDataId provides the TABLE DATA item's dump ID for each TABLE
- * TOC entry that has a DATA item. We compute this by reversing the
+ * TOC entry that has a DATA item. We compute this by reversing the
* TABLE DATA item's dependency, knowing that a TABLE DATA item has
* just one dependency and it is the TABLE item.
*/
@@ -1925,8 +1925,8 @@ _discoverArchiveFormat(ArchiveHandle *AH)
else
{
/*
- * *Maybe* we have a tar archive format file or a text dump ...
- * So, read first 512 byte header...
+ * *Maybe* we have a tar archive format file or a text dump ... So,
+ * read first 512 byte header...
*/
cnt = fread(&AH->lookahead[AH->lookaheadLen], 1, 512 - AH->lookaheadLen, fh);
AH->lookaheadLen += cnt;
@@ -1935,7 +1935,10 @@ _discoverArchiveFormat(ArchiveHandle *AH)
(strncmp(AH->lookahead, TEXT_DUMP_HEADER, strlen(TEXT_DUMP_HEADER)) == 0 ||
strncmp(AH->lookahead, TEXT_DUMPALL_HEADER, strlen(TEXT_DUMPALL_HEADER)) == 0))
{
- /* looks like it's probably a text format dump. so suggest they try psql */
+ /*
+ * looks like it's probably a text format dump. so suggest they
+ * try psql
+ */
exit_horribly(modulename, "input file appears to be a text format dump. Please use psql.\n");
}
@@ -2217,7 +2220,7 @@ ReadToc(ArchiveHandle *AH)
/* Sanity check */
if (te->dumpId <= 0)
exit_horribly(modulename,
- "entry ID %d out of range -- perhaps a corrupt TOC\n",
+ "entry ID %d out of range -- perhaps a corrupt TOC\n",
te->dumpId);
te->hadDumper = ReadInt(AH);
@@ -2835,8 +2838,8 @@ _selectTablespace(ArchiveHandle *AH, const char *tablespace)
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
warn_or_exit_horribly(AH, modulename,
- "could not set default_tablespace to %s: %s",
- fmtId(want), PQerrorMessage(AH->connection));
+ "could not set default_tablespace to %s: %s",
+ fmtId(want), PQerrorMessage(AH->connection));
PQclear(res);
}
@@ -3043,7 +3046,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
if (te->tablespace && !ropt->noTablespace)
{
- char *sanitized_tablespace;
+ char *sanitized_tablespace;
sanitized_tablespace = replace_line_endings(te->tablespace);
ahprintf(AH, "; Tablespace: %s", sanitized_tablespace);
@@ -3150,8 +3153,8 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
static char *
replace_line_endings(const char *str)
{
- char *result;
- char *s;
+ char *result;
+ char *s;
result = pg_strdup(str);
@@ -3381,7 +3384,7 @@ unsetProcessIdentifier(ParallelStateEntry *pse)
static ParallelStateEntry *
GetMyPSEntry(ParallelState *pstate)
{
- int i;
+ int i;
for (i = 0; i < pstate->numWorkers; i++)
#ifdef WIN32
@@ -3509,8 +3512,8 @@ restore_toc_entries_parallel(ArchiveHandle *AH)
DisconnectDatabase(&AH->public);
/*
- * Set the pstate in the shutdown_info. The exit handler uses pstate if set
- * and falls back to AHX otherwise.
+ * Set the pstate in the shutdown_info. The exit handler uses pstate if
+ * set and falls back to AHX otherwise.
*/
shutdown_info.pstate = pstate;
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 4361805baa..8859bd9776 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -256,7 +256,7 @@ typedef struct _archiveHandle
DumpId maxDumpId; /* largest DumpId among all TOC entries */
/* arrays created after the TOC list is complete: */
- struct _tocEntry **tocsByDumpId; /* TOCs indexed by dumpId */
+ struct _tocEntry **tocsByDumpId; /* TOCs indexed by dumpId */
DumpId *tableDataId; /* TABLE DATA ids, indexed by table dumpId */
struct _tocEntry *currToc; /* Used when dumping data */
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 2156d0f619..204309d6ad 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -466,7 +466,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
else if (!ctx->hasSeek)
exit_horribly(modulename, "could not find block ID %d in archive -- "
"possibly due to out-of-order restore request, "
- "which cannot be handled due to non-seekable input file\n",
+ "which cannot be handled due to non-seekable input file\n",
te->dumpId);
else /* huh, the dataPos led us to EOF? */
exit_horribly(modulename, "could not find block ID %d in archive -- "
@@ -572,10 +572,10 @@ _skipData(ArchiveHandle *AH)
{
if (feof(AH->FH))
exit_horribly(modulename,
- "could not read from input file: end of file\n");
+ "could not read from input file: end of file\n");
else
exit_horribly(modulename,
- "could not read from input file: %s\n", strerror(errno));
+ "could not read from input file: %s\n", strerror(errno));
}
ctx->filePos += blkLen;
@@ -646,7 +646,7 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
if (res != len)
exit_horribly(modulename,
- "could not write to output file: %s\n", strerror(errno));
+ "could not write to output file: %s\n", strerror(errno));
ctx->filePos += res;
return res;
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index b315e68192..d912aaf77f 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -182,7 +182,7 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
{
if (!PQconnectionNeedsPassword(newConn))
exit_horribly(modulename, "could not reconnect to database: %s",
- PQerrorMessage(newConn));
+ PQerrorMessage(newConn));
PQfinish(newConn);
if (password)
@@ -300,7 +300,7 @@ ConnectDatabase(Archive *AHX,
/* check to see that the backend connection was successfully made */
if (PQstatus(AH->connection) == CONNECTION_BAD)
exit_horribly(modulename, "connection to database \"%s\" failed: %s",
- PQdb(AH->connection), PQerrorMessage(AH->connection));
+ PQdb(AH->connection), PQerrorMessage(AH->connection));
/* check for version mismatch */
_check_database_version(AH);
@@ -313,7 +313,7 @@ DisconnectDatabase(Archive *AHX)
{
ArchiveHandle *AH = (ArchiveHandle *) AHX;
- PQfinish(AH->connection); /* noop if AH->connection is NULL */
+ PQfinish(AH->connection); /* noop if AH->connection is NULL */
AH->connection = NULL;
}
@@ -343,7 +343,7 @@ die_on_query_failure(ArchiveHandle *AH, const char *modulename, const char *quer
void
ExecuteSqlStatement(Archive *AHX, const char *query)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) AHX;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -355,7 +355,7 @@ ExecuteSqlStatement(Archive *AHX, const char *query)
PGresult *
ExecuteSqlQuery(Archive *AHX, const char *query, ExecStatusType status)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) AHX;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -436,7 +436,7 @@ ExecuteInsertCommands(ArchiveHandle *AH, const char *buf, size_t bufLen)
for (; qry < eos; qry++)
{
- char ch = *qry;
+ char ch = *qry;
/* For neatness, we skip any newlines between commands */
if (!(ch == '\n' && AH->sqlparse.curCmd->len == 0))
@@ -526,7 +526,7 @@ ExecuteSqlCommandBuf(ArchiveHandle *AH, const char *buf, size_t bufLen)
ExecuteSqlCommand(AH, buf, "could not execute query");
else
{
- char *str = (char *) pg_malloc(bufLen + 1);
+ char *str = (char *) pg_malloc(bufLen + 1);
memcpy(str, buf, bufLen);
str[bufLen] = '\0';
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 629e309abe..32dcb12fdf 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -178,7 +178,7 @@ InitArchiveFmt_Directory(ArchiveHandle *AH)
/* Nothing else in the file, so close it again... */
if (cfclose(tocFH) != 0)
exit_horribly(modulename, "could not close TOC file: %s\n",
- strerror(errno));
+ strerror(errno));
ctx->dataFH = NULL;
}
}
@@ -347,7 +347,7 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
if (!cfp)
exit_horribly(modulename, "could not open input file \"%s\": %s\n",
- filename, strerror(errno));
+ filename, strerror(errno));
buf = pg_malloc(ZLIB_OUT_SIZE);
buflen = ZLIB_OUT_SIZE;
@@ -356,9 +356,9 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
ahwrite(buf, 1, cnt, AH);
free(buf);
- if (cfclose(cfp) != 0)
+ if (cfclose(cfp) !=0)
exit_horribly(modulename, "could not close data file: %s\n",
- strerror(errno));
+ strerror(errno));
}
/*
@@ -417,7 +417,7 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
}
if (!cfeof(ctx->blobsTocFH))
exit_horribly(modulename, "error reading large object TOC file \"%s\"\n",
- fname);
+ fname);
if (cfclose(ctx->blobsTocFH) != 0)
exit_horribly(modulename, "could not close large object TOC file \"%s\": %s\n",
@@ -478,7 +478,7 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
res = cfwrite(buf, len, ctx->dataFH);
if (res != len)
exit_horribly(modulename, "could not write to output file: %s\n",
- strerror(errno));
+ strerror(errno));
return res;
}
@@ -589,7 +589,7 @@ _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid)
if (ctx->dataFH == NULL)
exit_horribly(modulename, "could not open output file \"%s\": %s\n",
- fname, strerror(errno));
+ fname, strerror(errno));
}
/*
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 9fe2b14df5..c5e19968b7 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -111,7 +111,7 @@ static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH);
#ifdef __NOT_USED__
static char *tarGets(char *buf, size_t len, TAR_MEMBER *th);
#endif
-static int tarPrintf(ArchiveHandle *AH, TAR_MEMBER *th, const char *fmt, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));
+static int tarPrintf(ArchiveHandle *AH, TAR_MEMBER *th, const char *fmt,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));
static void _tarAddFile(ArchiveHandle *AH, TAR_MEMBER *th);
static int _tarChecksum(char *th);
@@ -177,7 +177,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
ctx->tarFH = fopen(AH->fSpec, PG_BINARY_W);
if (ctx->tarFH == NULL)
exit_horribly(modulename,
- "could not open TOC file \"%s\" for output: %s\n",
+ "could not open TOC file \"%s\" for output: %s\n",
AH->fSpec, strerror(errno));
}
else
@@ -213,7 +213,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
*/
if (AH->compression != 0)
exit_horribly(modulename,
- "compression is not supported by tar archive format\n");
+ "compression is not supported by tar archive format\n");
}
else
{ /* Read Mode */
@@ -585,7 +585,7 @@ tarWrite(const void *buf, size_t len, TAR_MEMBER *th)
if (res != len)
exit_horribly(modulename,
- "could not write to output file: %s\n", strerror(errno));
+ "could not write to output file: %s\n", strerror(errno));
th->pos += res;
return res;
@@ -1230,7 +1230,7 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
snprintf(buf2, sizeof(buf2), INT64_FORMAT, (int64) ftello(ctx->tarFHpos));
exit_horribly(modulename,
"mismatch in actual vs. predicted file position (%s vs. %s)\n",
- buf1, buf2);
+ buf1, buf2);
}
#endif
@@ -1245,7 +1245,7 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
if (len != 512)
exit_horribly(modulename,
ngettext("incomplete tar header found (%lu byte)\n",
- "incomplete tar header found (%lu bytes)\n",
+ "incomplete tar header found (%lu bytes)\n",
len),
(unsigned long) len);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 3461f3e34c..d9aeee3c8d 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -221,9 +221,9 @@ static char *format_function_arguments_old(Archive *fout,
char **argmodes,
char **argnames);
static char *format_function_signature(Archive *fout,
- FuncInfo *finfo, bool honor_quotes);
+ FuncInfo *finfo, bool honor_quotes);
static const char *convertRegProcReference(Archive *fout,
- const char *proc);
+ const char *proc);
static const char *convertOperatorReference(Archive *fout, const char *opr);
static const char *convertTSFunction(Archive *fout, Oid funcOid);
static Oid findLastBuiltinOid_V71(Archive *fout, const char *);
@@ -232,7 +232,7 @@ static void selectSourceSchema(Archive *fout, const char *schemaName);
static char *getFormattedTypeName(Archive *fout, Oid oid, OidOptions opts);
static char *myFormatType(const char *typname, int32 typmod);
static const char *fmtQualifiedId(Archive *fout,
- const char *schema, const char *id);
+ const char *schema, const char *id);
static void getBlobs(Archive *fout);
static void dumpBlob(Archive *fout, BlobInfo *binfo);
static int dumpBlobs(Archive *fout, void *arg);
@@ -285,7 +285,7 @@ main(int argc, char **argv)
RestoreOptions *ropt;
ArchiveFormat archiveFormat = archUnknown;
ArchiveMode archiveMode;
- Archive *fout; /* the script file */
+ Archive *fout; /* the script file */
static int disable_triggers = 0;
static int outputNoTablespaces = 0;
@@ -495,7 +495,7 @@ main(int argc, char **argv)
use_role = optarg;
break;
- case 4: /* exclude table(s) data */
+ case 4: /* exclude table(s) data */
simple_string_list_append(&tabledata_exclude_patterns, optarg);
break;
@@ -605,7 +605,7 @@ main(int argc, char **argv)
"SERIALIZABLE, READ ONLY, DEFERRABLE");
else
ExecuteSqlStatement(fout,
- "SET TRANSACTION ISOLATION LEVEL "
+ "SET TRANSACTION ISOLATION LEVEL "
"REPEATABLE READ");
}
else
@@ -625,7 +625,7 @@ main(int argc, char **argv)
{
if (fout->remoteVersion >= 70100)
g_last_builtin_oid = findLastBuiltinOid_V71(fout,
- PQdb(GetConnection(fout)));
+ PQdb(GetConnection(fout)));
else
g_last_builtin_oid = findLastBuiltinOid_V70(fout);
if (g_verbose)
@@ -748,7 +748,7 @@ main(int argc, char **argv)
else
ropt->compression = compressLevel;
- ropt->suppressDumpWarnings = true; /* We've already shown them */
+ ropt->suppressDumpWarnings = true; /* We've already shown them */
SetArchiveRestoreOptions(fout, ropt);
@@ -1123,6 +1123,7 @@ selectDumpableType(TypeInfo *tyinfo)
if (tyinfo->isArray)
{
tyinfo->dobj.objType = DO_DUMMY_TYPE;
+
/*
* Fall through to set the dump flag; we assume that the subsequent
* rules will do the same thing as they would for the array's base
@@ -2666,7 +2667,7 @@ findNamespace(Archive *fout, Oid nsoid, Oid objoid)
else
{
/* This code depends on the dummy objects set up by getNamespaces. */
- Oid i;
+ Oid i;
if (objoid > g_last_builtin_oid)
i = 0; /* user object */
@@ -2938,7 +2939,7 @@ getTypes(Archive *fout, int *numTypes)
/*
* If it's a base type, make a DumpableObject representing a shell
* definition of the type. We will need to dump that ahead of the I/O
- * functions for the type. Similarly, range types need a shell
+ * functions for the type. Similarly, range types need a shell
* definition in case they have a canonicalize function.
*
* Note: the shell type doesn't have a catId. You might think it
@@ -3972,7 +3973,7 @@ getTables(Archive *fout, int *numTables)
"SELECT c.tableoid, c.oid, c.relname, "
"c.relacl, c.relkind, c.relnamespace, "
"(%s c.relowner) AS rolname, "
- "c.relchecks, (c.reltriggers <> 0) AS relhastriggers, "
+ "c.relchecks, (c.reltriggers <> 0) AS relhastriggers, "
"c.relhasindex, c.relhasrules, c.relhasoids, "
"c.relfrozenxid, tc.oid AS toid, "
"tc.relfrozenxid AS tfrozenxid, "
@@ -4278,9 +4279,9 @@ getTables(Archive *fout, int *numTables)
resetPQExpBuffer(query);
appendPQExpBuffer(query,
"LOCK TABLE %s IN ACCESS SHARE MODE",
- fmtQualifiedId(fout,
+ fmtQualifiedId(fout,
tblinfo[i].dobj.namespace->dobj.name,
- tblinfo[i].dobj.name));
+ tblinfo[i].dobj.name));
ExecuteSqlStatement(fout, query->data);
}
@@ -4879,7 +4880,7 @@ getDomainConstraints(Archive *fout, TypeInfo *tyinfo)
for (i = 0; i < ntups; i++)
{
- bool validated = PQgetvalue(res, i, 4)[0] == 't';
+ bool validated = PQgetvalue(res, i, 4)[0] == 't';
constrinfo[i].dobj.objType = DO_CONSTRAINT;
constrinfo[i].dobj.catId.tableoid = atooid(PQgetvalue(res, i, i_tableoid));
@@ -4901,7 +4902,7 @@ getDomainConstraints(Archive *fout, TypeInfo *tyinfo)
/*
* Make the domain depend on the constraint, ensuring it won't be
- * output till any constraint dependencies are OK. If the constraint
+ * output till any constraint dependencies are OK. If the constraint
* has not been validated, it's going to be dumped after the domain
* anyway, so this doesn't matter.
*/
@@ -5625,11 +5626,11 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
"pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
"array_to_string(a.attoptions, ', ') AS attoptions, "
"CASE WHEN a.attcollation <> t.typcollation "
- "THEN a.attcollation ELSE 0 END AS attcollation, "
+ "THEN a.attcollation ELSE 0 END AS attcollation, "
"pg_catalog.array_to_string(ARRAY("
"SELECT pg_catalog.quote_ident(option_name) || "
"' ' || pg_catalog.quote_literal(option_value) "
- "FROM pg_catalog.pg_options_to_table(attfdwoptions) "
+ "FROM pg_catalog.pg_options_to_table(attfdwoptions) "
"ORDER BY option_name"
"), E',\n ') AS attfdwoptions "
"FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
@@ -5654,7 +5655,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
"pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
"array_to_string(a.attoptions, ', ') AS attoptions, "
"CASE WHEN a.attcollation <> t.typcollation "
- "THEN a.attcollation ELSE 0 END AS attcollation, "
+ "THEN a.attcollation ELSE 0 END AS attcollation, "
"NULL AS attfdwoptions "
"FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
"ON a.atttypid = t.oid "
@@ -5898,8 +5899,8 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
/*
* Defaults on a VIEW must always be dumped as separate ALTER
* TABLE commands. Defaults on regular tables are dumped as
- * part of the CREATE TABLE if possible, which it won't be
- * if the column is not going to be emitted explicitly.
+ * part of the CREATE TABLE if possible, which it won't be if
+ * the column is not going to be emitted explicitly.
*/
if (tbinfo->relkind == RELKIND_VIEW)
{
@@ -5919,6 +5920,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
else
{
attrdefs[j].separate = false;
+
/*
* Mark the default as needing to appear before the table,
* so that any dependencies it has must be emitted before
@@ -6051,7 +6053,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
for (j = 0; j < numConstrs; j++)
{
- bool validated = PQgetvalue(res, j, 5)[0] == 't';
+ bool validated = PQgetvalue(res, j, 5)[0] == 't';
constrs[j].dobj.objType = DO_CONSTRAINT;
constrs[j].dobj.catId.tableoid = atooid(PQgetvalue(res, j, 0));
@@ -6068,6 +6070,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
constrs[j].condeferrable = false;
constrs[j].condeferred = false;
constrs[j].conislocal = (PQgetvalue(res, j, 4)[0] == 't');
+
/*
* An unvalidated constraint needs to be dumped separately, so
* that potentially-violating existing data is loaded before
@@ -6081,10 +6084,10 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
* Mark the constraint as needing to appear before the table
* --- this is so that any other dependencies of the
* constraint will be emitted before we try to create the
- * table. If the constraint is to be dumped separately, it will be
- * dumped after data is loaded anyway, so don't do it. (There's
- * an automatic dependency in the opposite direction anyway, so
- * don't need to add one manually here.)
+ * table. If the constraint is to be dumped separately, it
+ * will be dumped after data is loaded anyway, so don't do it.
+ * (There's an automatic dependency in the opposite direction
+ * anyway, so don't need to add one manually here.)
*/
if (!constrs[j].separate)
addObjectDependency(&tbinfo->dobj,
@@ -6597,7 +6600,7 @@ getForeignServers(Archive *fout, int *numForeignServers)
}
/* Make sure we are in proper schema */
- selectSourceSchema(fout,"pg_catalog");
+ selectSourceSchema(fout, "pg_catalog");
appendPQExpBuffer(query, "SELECT tableoid, oid, srvname, "
"(%s srvowner) AS rolname, "
@@ -7531,7 +7534,7 @@ dumpRangeType(Archive *fout, TypeInfo *tyinfo)
selectSourceSchema(fout, tyinfo->dobj.namespace->dobj.name);
appendPQExpBuffer(query,
- "SELECT pg_catalog.format_type(rngsubtype, NULL) AS rngsubtype, "
+ "SELECT pg_catalog.format_type(rngsubtype, NULL) AS rngsubtype, "
"opc.opcname AS opcname, "
"(SELECT nspname FROM pg_catalog.pg_namespace nsp "
" WHERE nsp.oid = opc.opcnamespace) AS opcnsp, "
@@ -7570,8 +7573,8 @@ dumpRangeType(Archive *fout, TypeInfo *tyinfo)
/* print subtype_opclass only if not default for subtype */
if (PQgetvalue(res, 0, PQfnumber(res, "opcdefault"))[0] != 't')
{
- char *opcname = PQgetvalue(res, 0, PQfnumber(res, "opcname"));
- char *nspname = PQgetvalue(res, 0, PQfnumber(res, "opcnsp"));
+ char *opcname = PQgetvalue(res, 0, PQfnumber(res, "opcname"));
+ char *nspname = PQgetvalue(res, 0, PQfnumber(res, "opcnsp"));
/* always schema-qualify, don't try to be smart */
appendPQExpBuffer(q, ",\n subtype_opclass = %s.",
@@ -9409,12 +9412,12 @@ dumpCast(Archive *fout, CastInfo *cast)
labelq = createPQExpBuffer();
appendPQExpBuffer(delqry, "DROP CAST (%s AS %s);\n",
- getFormattedTypeName(fout, cast->castsource, zeroAsNone),
- getFormattedTypeName(fout, cast->casttarget, zeroAsNone));
+ getFormattedTypeName(fout, cast->castsource, zeroAsNone),
+ getFormattedTypeName(fout, cast->casttarget, zeroAsNone));
appendPQExpBuffer(defqry, "CREATE CAST (%s AS %s) ",
- getFormattedTypeName(fout, cast->castsource, zeroAsNone),
- getFormattedTypeName(fout, cast->casttarget, zeroAsNone));
+ getFormattedTypeName(fout, cast->castsource, zeroAsNone),
+ getFormattedTypeName(fout, cast->casttarget, zeroAsNone));
switch (cast->castmethod)
{
@@ -9427,14 +9430,15 @@ dumpCast(Archive *fout, CastInfo *cast)
case COERCION_METHOD_FUNCTION:
if (funcInfo)
{
- char *fsig = format_function_signature(fout, funcInfo, true);
+ char *fsig = format_function_signature(fout, funcInfo, true);
/*
* Always qualify the function name, in case it is not in
- * pg_catalog schema (format_function_signature won't qualify it).
+ * pg_catalog schema (format_function_signature won't qualify
+ * it).
*/
appendPQExpBuffer(defqry, "WITH FUNCTION %s.%s",
- fmtId(funcInfo->dobj.namespace->dobj.name), fsig);
+ fmtId(funcInfo->dobj.namespace->dobj.name), fsig);
free(fsig);
}
else
@@ -9451,8 +9455,8 @@ dumpCast(Archive *fout, CastInfo *cast)
appendPQExpBuffer(defqry, ";\n");
appendPQExpBuffer(labelq, "CAST (%s AS %s)",
- getFormattedTypeName(fout, cast->castsource, zeroAsNone),
- getFormattedTypeName(fout, cast->casttarget, zeroAsNone));
+ getFormattedTypeName(fout, cast->castsource, zeroAsNone),
+ getFormattedTypeName(fout, cast->casttarget, zeroAsNone));
if (binary_upgrade)
binary_upgrade_extension_member(defqry, &cast->dobj, labelq->data);
@@ -11715,7 +11719,7 @@ dumpACL(Archive *fout, CatalogId objCatId, DumpId objDumpId,
if (!buildACLCommands(name, subname, type, acls, owner,
"", fout->remoteVersion, sql))
exit_horribly(NULL,
- "could not parse ACL list (%s) for object \"%s\" (%s)\n",
+ "could not parse ACL list (%s) for object \"%s\" (%s)\n",
acls, name, type);
if (sql->len > 0)
@@ -12157,10 +12161,10 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
{
if (PQntuples(res) < 1)
exit_horribly(NULL, "query to obtain definition of view \"%s\" returned no data\n",
- tbinfo->dobj.name);
+ tbinfo->dobj.name);
else
exit_horribly(NULL, "query to obtain definition of view \"%s\" returned more than one definition\n",
- tbinfo->dobj.name);
+ tbinfo->dobj.name);
}
viewdef = PQgetvalue(res, 0, 0);
@@ -12207,7 +12211,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
"pg_catalog.array_to_string(ARRAY("
"SELECT pg_catalog.quote_ident(option_name) || "
"' ' || pg_catalog.quote_literal(option_value) "
- "FROM pg_catalog.pg_options_to_table(ftoptions) "
+ "FROM pg_catalog.pg_options_to_table(ftoptions) "
"ORDER BY option_name"
"), E',\n ') AS ftoptions "
"FROM pg_catalog.pg_foreign_table ft "
@@ -13152,7 +13156,7 @@ findLastBuiltinOid_V70(Archive *fout)
int last_oid;
res = ExecuteSqlQueryForSingleRow(fout,
- "SELECT oid FROM pg_class WHERE relname = 'pg_indexes'");
+ "SELECT oid FROM pg_class WHERE relname = 'pg_indexes'");
last_oid = atooid(PQgetvalue(res, 0, PQfnumber(res, "oid")));
PQclear(res);
return last_oid;
@@ -13882,8 +13886,8 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
continue;
/*
- * Note: config tables are dumped without OIDs regardless
- * of the --oids setting. This is because row filtering
+ * Note: config tables are dumped without OIDs regardless of
+ * the --oids setting. This is because row filtering
* conditions aren't compatible with dumping OIDs.
*/
makeTableDataInfo(configtbl, false);
@@ -14284,7 +14288,7 @@ ExecuteSqlQueryForSingleRow(Archive *fout, char *query)
exit_horribly(NULL,
ngettext("query returned %d row instead of one: %s\n",
"query returned %d rows instead of one: %s\n",
- ntups),
+ ntups),
ntups, query);
return res;
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c
index 2a1b4299ca..9a82e4b6c5 100644
--- a/src/bin/pg_dump/pg_dump_sort.c
+++ b/src/bin/pg_dump/pg_dump_sort.c
@@ -111,7 +111,7 @@ static bool TopoSort(DumpableObject **objs,
static void addHeapElement(int val, int *heap, int heapLength);
static int removeHeapElement(int *heap, int heapLength);
static void findDependencyLoops(DumpableObject **objs, int nObjs, int totObjs);
-static int findLoop(DumpableObject *obj,
+static int findLoop(DumpableObject *obj,
DumpId startPoint,
bool *processed,
DumpableObject **workspace,
@@ -139,8 +139,8 @@ sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
static int
DOTypeNameCompare(const void *p1, const void *p2)
{
- DumpableObject *obj1 = *(DumpableObject * const *) p1;
- DumpableObject *obj2 = *(DumpableObject * const *) p2;
+ DumpableObject *obj1 = *(DumpableObject *const *) p1;
+ DumpableObject *obj2 = *(DumpableObject *const *) p2;
int cmpval;
/* Sort by type */
@@ -171,8 +171,8 @@ DOTypeNameCompare(const void *p1, const void *p2)
/* To have a stable sort order, break ties for some object types */
if (obj1->objType == DO_FUNC || obj1->objType == DO_AGG)
{
- FuncInfo *fobj1 = *(FuncInfo * const *) p1;
- FuncInfo *fobj2 = *(FuncInfo * const *) p2;
+ FuncInfo *fobj1 = *(FuncInfo *const *) p1;
+ FuncInfo *fobj2 = *(FuncInfo *const *) p2;
cmpval = fobj1->nargs - fobj2->nargs;
if (cmpval != 0)
@@ -180,8 +180,8 @@ DOTypeNameCompare(const void *p1, const void *p2)
}
else if (obj1->objType == DO_OPERATOR)
{
- OprInfo *oobj1 = *(OprInfo * const *) p1;
- OprInfo *oobj2 = *(OprInfo * const *) p2;
+ OprInfo *oobj1 = *(OprInfo *const *) p1;
+ OprInfo *oobj2 = *(OprInfo *const *) p2;
/* oprkind is 'l', 'r', or 'b'; this sorts prefix, postfix, infix */
cmpval = (oobj2->oprkind - oobj1->oprkind);
@@ -190,8 +190,8 @@ DOTypeNameCompare(const void *p1, const void *p2)
}
else if (obj1->objType == DO_ATTRDEF)
{
- AttrDefInfo *adobj1 = *(AttrDefInfo * const *) p1;
- AttrDefInfo *adobj2 = *(AttrDefInfo * const *) p2;
+ AttrDefInfo *adobj1 = *(AttrDefInfo *const *) p1;
+ AttrDefInfo *adobj2 = *(AttrDefInfo *const *) p2;
cmpval = (adobj1->adnum - adobj2->adnum);
if (cmpval != 0)
@@ -220,8 +220,8 @@ sortDumpableObjectsByTypeOid(DumpableObject **objs, int numObjs)
static int
DOTypeOidCompare(const void *p1, const void *p2)
{
- DumpableObject *obj1 = *(DumpableObject * const *) p1;
- DumpableObject *obj2 = *(DumpableObject * const *) p2;
+ DumpableObject *obj1 = *(DumpableObject *const *) p1;
+ DumpableObject *obj2 = *(DumpableObject *const *) p2;
int cmpval;
cmpval = oldObjectTypePriority[obj1->objType] -
@@ -545,7 +545,7 @@ findDependencyLoops(DumpableObject **objs, int nObjs, int totObjs)
{
/*
* There's no loop starting at this object, but mark it processed
- * anyway. This is not necessary for correctness, but saves later
+ * anyway. This is not necessary for correctness, but saves later
* invocations of findLoop() from uselessly chasing references to
* such an object.
*/
@@ -587,7 +587,7 @@ findLoop(DumpableObject *obj,
int i;
/*
- * Reject if obj is already processed. This test prevents us from finding
+ * Reject if obj is already processed. This test prevents us from finding
* loops that overlap previously-processed loops.
*/
if (processed[obj->dumpId])
@@ -645,7 +645,7 @@ findLoop(DumpableObject *obj,
* A user-defined datatype will have a dependency loop with each of its
* I/O functions (since those have the datatype as input or output).
* Similarly, a range type will have a loop with its canonicalize function,
- * if any. Break the loop by making the function depend on the associated
+ * if any. Break the loop by making the function depend on the associated
* shell type, instead.
*/
static void
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 34d6920364..053e5fd36a 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -52,8 +52,8 @@ static void doShellQuoting(PQExpBuffer buf, const char *str);
static int runPgDump(const char *dbname);
static void buildShSecLabels(PGconn *conn, const char *catalog_name,
- uint32 objectId, PQExpBuffer buffer,
- const char *target, const char *objname);
+ uint32 objectId, PQExpBuffer buffer,
+ const char *target, const char *objname);
static PGconn *connectDatabase(const char *dbname, const char *pghost, const char *pgport,
const char *pguser, enum trivalue prompt_password, bool fail_on_error);
static PGresult *executeQuery(PGconn *conn, const char *query);
@@ -1663,7 +1663,7 @@ static void
buildShSecLabels(PGconn *conn, const char *catalog_name, uint32 objectId,
PQExpBuffer buffer, const char *target, const char *objname)
{
- PQExpBuffer sql = createPQExpBuffer();
+ PQExpBuffer sql = createPQExpBuffer();
PGresult *res;
buildShSecLabelQuery(conn, catalog_name, objectId, sql);
diff --git a/src/bin/pgevent/pgevent.c b/src/bin/pgevent/pgevent.c
index 669be05c22..91d35b4daf 100644
--- a/src/bin/pgevent/pgevent.c
+++ b/src/bin/pgevent/pgevent.c
@@ -113,7 +113,7 @@ DllRegisterServer(void)
"TypesSupported",
0,
REG_DWORD,
- (LPBYTE) & data,
+ (LPBYTE) &data,
sizeof(DWORD)))
{
MessageBox(NULL, "Could not set the supported types.", "PostgreSQL error", MB_OK | MB_ICONSTOP);
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 8544d15109..5614120255 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -777,7 +777,7 @@ exec_command(const char *cmd,
/* \i and \ir include files */
else if (strcmp(cmd, "i") == 0 || strcmp(cmd, "include") == 0
- || strcmp(cmd, "ir") == 0 || strcmp(cmd, "include_relative") == 0)
+ || strcmp(cmd, "ir") == 0 || strcmp(cmd, "include_relative") == 0)
{
char *fname = psql_scan_slash_option(scan_state,
OT_NORMAL, NULL, true);
@@ -789,7 +789,7 @@ exec_command(const char *cmd,
}
else
{
- bool include_relative;
+ bool include_relative;
include_relative = (strcmp(cmd, "ir") == 0
|| strcmp(cmd, "include_relative") == 0);
@@ -1103,16 +1103,16 @@ exec_command(const char *cmd,
else if (strcmp(cmd, "setenv") == 0)
{
char *envvar = psql_scan_slash_option(scan_state,
- OT_NORMAL, NULL, false);
+ OT_NORMAL, NULL, false);
char *envval = psql_scan_slash_option(scan_state,
- OT_NORMAL, NULL, false);
+ OT_NORMAL, NULL, false);
if (!envvar)
{
psql_error("\\%s: missing required argument\n", cmd);
success = false;
}
- else if (strchr(envvar,'=') != NULL)
+ else if (strchr(envvar, '=') != NULL)
{
psql_error("\\%s: environment variable name must not contain \"=\"\n",
cmd);
@@ -1127,16 +1127,17 @@ exec_command(const char *cmd,
else
{
/* Set variable to the value of the next argument */
- int len = strlen(envvar) + strlen(envval) + 1;
+ int len = strlen(envvar) + strlen(envval) + 1;
char *newval = pg_malloc(len + 1);
- snprintf(newval, len+1, "%s=%s", envvar, envval);
+ snprintf(newval, len + 1, "%s=%s", envvar, envval);
putenv(newval);
success = true;
+
/*
- * Do not free newval here, it will screw up the environment
- * if you do. See putenv man page for details. That means we
- * leak a bit of memory here, but not enough to worry about.
+ * Do not free newval here, it will screw up the environment if
+ * you do. See putenv man page for details. That means we leak a
+ * bit of memory here, but not enough to worry about.
*/
}
free(envvar);
@@ -2046,9 +2047,9 @@ process_file(char *filename, bool single_txn, bool use_relative_path)
/*
* If we were asked to resolve the pathname relative to the location
- * of the currently executing script, and there is one, and this is
- * a relative pathname, then prepend all but the last pathname
- * component of the current script to this pathname.
+ * of the currently executing script, and there is one, and this is a
+ * relative pathname, then prepend all but the last pathname component
+ * of the current script to this pathname.
*/
if (use_relative_path && pset.inputfile && !is_absolute_path(filename)
&& !has_drive_prefix(filename))
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 33dc97e95f..3691b507a4 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -707,7 +707,7 @@ ProcessResult(PGresult **results)
/*
* Call PQgetResult() once more. In the typical case of a
- * single-command string, it will return NULL. Otherwise, we'll
+ * single-command string, it will return NULL. Otherwise, we'll
* have other results to process that may include other COPYs.
*/
PQclear(*results);
@@ -982,11 +982,12 @@ SendQuery(const char *query)
break;
case PQTRANS_INTRANS:
+
/*
* Do nothing if they are messing with savepoints themselves:
- * If the user did RELEASE or ROLLBACK, our savepoint is
- * gone. If they issued a SAVEPOINT, releasing ours would
- * remove theirs.
+ * If the user did RELEASE or ROLLBACK, our savepoint is gone.
+ * If they issued a SAVEPOINT, releasing ours would remove
+ * theirs.
*/
if (results &&
(strcmp(PQcmdStatus(results), "SAVEPOINT") == 0 ||
diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c
index a1dea9502c..22fcc5975e 100644
--- a/src/bin/psql/copy.c
+++ b/src/bin/psql/copy.c
@@ -394,7 +394,7 @@ handleCopyOut(PGconn *conn, FILE *copystream)
/*
* Check command status and return to normal libpq state. After a
* client-side error, the server will remain ready to deliver data. The
- * cleanest thing is to fully drain and discard that data. If the
+ * cleanest thing is to fully drain and discard that data. If the
* client-side error happened early in a large file, this takes a long
* time. Instead, take advantage of the fact that PQexec() will silently
* end any ongoing PGRES_COPY_OUT state. This does cause us to lose the
@@ -405,7 +405,7 @@ handleCopyOut(PGconn *conn, FILE *copystream)
* We must not ever return with the status still PGRES_COPY_OUT. Our
* caller is unable to distinguish that situation from reaching the next
* COPY in a command string that happened to contain two consecutive COPY
- * TO STDOUT commands. We trust that no condition can make PQexec() fail
+ * TO STDOUT commands. We trust that no condition can make PQexec() fail
* indefinitely while retaining status PGRES_COPY_OUT.
*/
while (res = PQgetResult(conn), PQresultStatus(res) == PGRES_COPY_OUT)
@@ -584,6 +584,7 @@ handleCopyIn(PGconn *conn, FILE *copystream, bool isbinary)
OK = false;
copyin_cleanup:
+
/*
* Check command status and return to normal libpq state
*
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 2cfacd34e3..9170dc6982 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -142,15 +142,15 @@ describeTablespaces(const char *pattern, bool verbose)
if (pset.sversion >= 90200)
printfPQExpBuffer(&buf,
"SELECT spcname AS \"%s\",\n"
- " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
- " pg_catalog.pg_tablespace_location(oid) AS \"%s\"",
+ " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
+ " pg_catalog.pg_tablespace_location(oid) AS \"%s\"",
gettext_noop("Name"),
gettext_noop("Owner"),
gettext_noop("Location"));
else
printfPQExpBuffer(&buf,
"SELECT spcname AS \"%s\",\n"
- " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
+ " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
" spclocation AS \"%s\"",
gettext_noop("Name"),
gettext_noop("Owner"),
@@ -910,7 +910,7 @@ objectDescription(const char *pattern, bool showSystem)
if (!showSystem && !pattern)
appendPQExpBuffer(&buf, " AND n.nspname <> 'pg_catalog'\n"
- " AND n.nspname <> 'information_schema'\n");
+ " AND n.nspname <> 'information_schema'\n");
processSQLNamePattern(pset.db, &buf, pattern, true, false,
"n.nspname", "o.opcname", NULL,
@@ -926,7 +926,7 @@ objectDescription(const char *pattern, bool showSystem)
/* Operator family descriptions */
appendPQExpBuffer(&buf,
"UNION ALL\n"
- " SELECT opf.oid as oid, opf.tableoid as tableoid,\n"
+ " SELECT opf.oid as oid, opf.tableoid as tableoid,\n"
" n.nspname as nspname,\n"
" CAST(opf.opfname AS pg_catalog.text) AS name,\n"
" CAST('%s' AS pg_catalog.text) as object\n"
@@ -939,7 +939,7 @@ objectDescription(const char *pattern, bool showSystem)
if (!showSystem && !pattern)
appendPQExpBuffer(&buf, " AND n.nspname <> 'pg_catalog'\n"
- " AND n.nspname <> 'information_schema'\n");
+ " AND n.nspname <> 'information_schema'\n");
processSQLNamePattern(pset.db, &buf, pattern, true, false,
"n.nspname", "opf.opfname", NULL,
@@ -1294,14 +1294,15 @@ describeOneTableDetails(const char *schemaname,
appendPQExpBuffer(&buf, ",\n NULL AS indexdef");
if (tableinfo.relkind == 'f' && pset.sversion >= 90200)
appendPQExpBuffer(&buf, ",\n CASE WHEN attfdwoptions IS NULL THEN '' ELSE "
- " '(' || array_to_string(ARRAY(SELECT quote_ident(option_name) || ' ' || quote_literal(option_value) FROM "
- " pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions");
+ " '(' || array_to_string(ARRAY(SELECT quote_ident(option_name) || ' ' || quote_literal(option_value) FROM "
+ " pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions");
else
appendPQExpBuffer(&buf, ",\n NULL AS attfdwoptions");
if (verbose)
{
appendPQExpBuffer(&buf, ",\n a.attstorage");
appendPQExpBuffer(&buf, ",\n CASE WHEN a.attstattarget=-1 THEN NULL ELSE a.attstattarget END AS attstattarget");
+
/*
* In 9.0+, we have column comments for: relations, views, composite
* types, and foreign tables (c.f. CommentObject() in comment.c).
@@ -1416,7 +1417,7 @@ describeOneTableDetails(const char *schemaname,
PGresult *result;
printfPQExpBuffer(&buf,
- "SELECT pg_catalog.pg_get_viewdef('%s'::pg_catalog.oid, true);",
+ "SELECT pg_catalog.pg_get_viewdef('%s'::pg_catalog.oid, true);",
oid);
result = PSQLexec(buf.data, false);
if (!result)
@@ -1651,13 +1652,13 @@ describeOneTableDetails(const char *schemaname,
"\n pg_catalog.quote_ident(relname) || '.' ||"
"\n pg_catalog.quote_ident(attname)"
"\nFROM pg_catalog.pg_class c"
- "\nINNER JOIN pg_catalog.pg_depend d ON c.oid=d.refobjid"
- "\nINNER JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace"
+ "\nINNER JOIN pg_catalog.pg_depend d ON c.oid=d.refobjid"
+ "\nINNER JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace"
"\nINNER JOIN pg_catalog.pg_attribute a ON ("
"\n a.attrelid=c.oid AND"
"\n a.attnum=d.refobjsubid)"
- "\nWHERE d.classid='pg_catalog.pg_class'::pg_catalog.regclass"
- "\n AND d.refclassid='pg_catalog.pg_class'::pg_catalog.regclass"
+ "\nWHERE d.classid='pg_catalog.pg_class'::pg_catalog.regclass"
+ "\n AND d.refclassid='pg_catalog.pg_class'::pg_catalog.regclass"
"\n AND d.objid=%s"
"\n AND d.deptype='a'",
oid);
@@ -1671,10 +1672,11 @@ describeOneTableDetails(const char *schemaname,
PQgetvalue(result, 0, 0));
printTableAddFooter(&cont, buf.data);
}
+
/*
- * If we get no rows back, don't show anything (obviously).
- * We should never get more than one row back, but if we do,
- * just ignore it and don't print anything.
+ * If we get no rows back, don't show anything (obviously). We should
+ * never get more than one row back, but if we do, just ignore it and
+ * don't print anything.
*/
PQclear(result);
}
@@ -1711,7 +1713,7 @@ describeOneTableDetails(const char *schemaname,
" LEFT JOIN pg_catalog.pg_constraint con ON (conrelid = i.indrelid AND conindid = i.indexrelid AND contype IN ('p','u','x'))\n");
appendPQExpBuffer(&buf,
"WHERE c.oid = '%s' AND c.oid = i.indrelid AND i.indexrelid = c2.oid\n"
- "ORDER BY i.indisprimary DESC, i.indisunique DESC, c2.relname;",
+ "ORDER BY i.indisprimary DESC, i.indisunique DESC, c2.relname;",
oid);
result = PSQLexec(buf.data, false);
if (!result)
@@ -1823,7 +1825,7 @@ describeOneTableDetails(const char *schemaname,
"SELECT conname,\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;",
+ "WHERE r.conrelid = '%s' AND r.contype = 'f' ORDER BY 1;",
oid);
result = PSQLexec(buf.data, false);
if (!result)
@@ -1854,7 +1856,7 @@ describeOneTableDetails(const char *schemaname,
"SELECT conname, conrelid::pg_catalog.regclass,\n"
" pg_catalog.pg_get_constraintdef(c.oid, true) as condef\n"
"FROM pg_catalog.pg_constraint c\n"
- "WHERE c.confrelid = '%s' AND c.contype = 'f' ORDER BY 1;",
+ "WHERE c.confrelid = '%s' AND c.contype = 'f' ORDER BY 1;",
oid);
result = PSQLexec(buf.data, false);
if (!result)
@@ -2105,7 +2107,7 @@ describeOneTableDetails(const char *schemaname,
/* print foreign server name */
if (tableinfo.relkind == 'f')
{
- char *ftoptions;
+ char *ftoptions;
/* Footer information about foreign table */
printfPQExpBuffer(&buf,
@@ -2113,7 +2115,7 @@ describeOneTableDetails(const char *schemaname,
" array_to_string(ARRAY(SELECT "
" quote_ident(option_name) || ' ' || "
" quote_literal(option_value) FROM "
- " pg_options_to_table(ftoptions)), ', ') "
+ " pg_options_to_table(ftoptions)), ', ') "
"FROM pg_catalog.pg_foreign_table f,\n"
" pg_catalog.pg_foreign_server s\n"
"WHERE f.ftrelid = %s AND s.oid = f.ftserver;",
@@ -2841,7 +2843,7 @@ listDomains(const char *pattern, bool verbose, bool showSystem)
appendPQExpBuffer(&buf,
"\nFROM pg_catalog.pg_type t\n"
- " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n");
+ " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n");
if (verbose)
appendPQExpBuffer(&buf,
@@ -3769,7 +3771,7 @@ listForeignDataWrappers(const char *pattern, bool verbose)
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
"SELECT fdw.fdwname AS \"%s\",\n"
- " pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n",
+ " pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n",
gettext_noop("Name"),
gettext_noop("Owner"));
if (pset.sversion >= 90100)
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index eff0ea53b6..4a37c3414c 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -124,9 +124,9 @@ usage(void)
printf(_(" -T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border)\n"));
printf(_(" -x, --expanded turn on expanded table output\n"));
printf(_(" -z, --field-separator-zero\n"
- " set field separator to zero byte\n"));
+ " set field separator to zero byte\n"));
printf(_(" -0, --record-separator-zero\n"
- " set record separator to zero byte\n"));
+ " set record separator to zero byte\n"));
printf(_("\nConnection options:\n"));
/* Display default host */
@@ -247,7 +247,7 @@ slashUsage(unsigned short int pager)
ON(pset.popt.topt.tuples_only));
fprintf(output, _(" \\T [STRING] set HTML <table> tag attributes, or unset if none\n"));
fprintf(output, _(" \\x [on|off|auto] toggle expanded output (currently %s)\n"),
- pset.popt.topt.expanded == 2 ? "auto" : ON(pset.popt.topt.expanded));
+ pset.popt.topt.expanded == 2 ? "auto" : ON(pset.popt.topt.expanded));
fprintf(output, "\n");
fprintf(output, _("Connection\n"));
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 880e7e6511..1a446e2afe 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -288,7 +288,8 @@ initializeInput(int flags)
if (histfile == NULL)
{
- char * envhist;
+ char *envhist;
+
envhist = getenv("PSQL_HISTORY");
if (envhist != NULL && strlen(envhist) > 0)
histfile = envhist;
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index c431f6a437..8fa5e37128 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -44,8 +44,8 @@ static char *decimal_point;
static char *grouping;
static char *thousands_sep;
-static char default_footer[100];
-static printTableFooter default_footer_cell = { default_footer, NULL };
+static char default_footer[100];
+static printTableFooter default_footer_cell = {default_footer, NULL};
/* Line style control structures */
const printTextFormat pg_asciiformat =
@@ -283,7 +283,7 @@ print_separator(struct separator sep, FILE *fout)
/*
* Return the list of explicitly-requested footers or, when applicable, the
- * default "(xx rows)" footer. Always omit the default footer when given
+ * default "(xx rows)" footer. Always omit the default footer when given
* non-default footers, "\pset footer off", or a specific instruction to that
* effect from a calling backslash command. Vertical formats number each row,
* making the default footer redundant; they do not call this function.
@@ -388,6 +388,7 @@ print_unaligned_text(const printTableContent *cont, FILE *fout)
need_recordsep = true;
}
}
+
/*
* The last record is terminated by a newline, independent of the set
* record separator. But when the record separator is a zero byte, we
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index 25adfc5813..2b2ad0ba4e 100644
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
@@ -89,7 +89,7 @@ typedef struct printTableOpt
unsigned long prior_records; /* start offset for record counters */
const printTextFormat *line_style; /* line style (NULL for default) */
struct separator fieldSep; /* field separator for unaligned text mode */
- struct separator recordSep; /* record separator for unaligned text mode */
+ struct separator recordSep; /* record separator for unaligned text mode */
bool numericLocale; /* locale-aware numeric units separator and
* decimal marker */
char *tableAttr; /* attributes for HTML <table ...> */
@@ -162,9 +162,9 @@ extern void printTableInit(printTableContent *const content,
const printTableOpt *opt, const char *title,
const int ncolumns, const int nrows);
extern void printTableAddHeader(printTableContent *const content,
- char *header, const bool translate, const char align);
+ char *header, const bool translate, const char align);
extern void printTableAddCell(printTableContent *const content,
- char *cell, const bool translate, const bool mustfree);
+ char *cell, const bool translate, const bool mustfree);
extern void printTableAddFooter(printTableContent *const content,
const char *footer);
extern void printTableSetFooter(printTableContent *const content,
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 1c2a5b3577..9a6306b8cf 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -591,7 +591,7 @@ process_psqlrc(char *argv0)
char rc_file[MAXPGPATH];
char my_exec_path[MAXPGPATH];
char etc_path[MAXPGPATH];
- char *envrc;
+ char *envrc;
find_my_exec(argv0, my_exec_path);
get_etc_path(my_exec_path, etc_path);
@@ -600,7 +600,7 @@ process_psqlrc(char *argv0)
process_psqlrc_file(rc_file);
envrc = getenv("PSQLRC");
-
+
if (envrc != NULL && strlen(envrc) > 0)
{
expand_tilde(&envrc);
@@ -618,7 +618,8 @@ process_psqlrc(char *argv0)
static void
process_psqlrc_file(char *filename)
{
- char *psqlrc_minor, *psqlrc_major;
+ char *psqlrc_minor,
+ *psqlrc_major;
#if defined(WIN32) && (!defined(__MINGW32__))
#define R_OK 4
diff --git a/src/bin/psql/stringutils.c b/src/bin/psql/stringutils.c
index 77387dcf3d..b557c5a6ba 100644
--- a/src/bin/psql/stringutils.c
+++ b/src/bin/psql/stringutils.c
@@ -277,7 +277,7 @@ strip_quotes(char *source, char quote, char escape, int encoding)
/*
* quote_if_needed
*
- * Opposite of strip_quotes(). If "source" denotes itself literally without
+ * Opposite of strip_quotes(). If "source" denotes itself literally without
* quoting or escaping, returns NULL. Otherwise, returns a malloc'd copy with
* quoting and escaping applied:
*
@@ -303,7 +303,7 @@ quote_if_needed(const char *source, const char *entails_quote,
psql_assert(quote);
src = source;
- dst = ret = pg_malloc(2 * strlen(src) + 3); /* excess */
+ dst = ret = pg_malloc(2 * strlen(src) + 3); /* excess */
*dst++ = quote;
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index a50e7356f1..061acd13b2 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -132,7 +132,7 @@ static const char *const * completion_charpp; /* to pass a list of strings */
static const char *completion_info_charp; /* to pass a second string */
static const char *completion_info_charp2; /* to pass a third string */
static const SchemaQuery *completion_squery; /* to pass a SchemaQuery */
-static bool completion_case_sensitive; /* completion is case sensitive */
+static bool completion_case_sensitive; /* completion is case sensitive */
/*
* A few macros to ease typing. You can use these to complete the given
@@ -790,9 +790,9 @@ psql_completion(char *text, int start, int end)
completion_info_charp2 = NULL;
/*
- * Scan the input line before our current position for the last few
- * words. According to those we'll make some smart decisions on what the
- * user is probably intending to type.
+ * Scan the input line before our current position for the last few words.
+ * According to those we'll make some smart decisions on what the user is
+ * probably intending to type.
*/
get_previous_words(start, previous_words, lengthof(previous_words));
@@ -1041,7 +1041,7 @@ psql_completion(char *text, int start, int end)
"ENCRYPTED", "INHERIT", "LOGIN", "NOCREATEDB", "NOCREATEROLE",
"NOCREATEUSER", "NOINHERIT", "NOLOGIN", "NOREPLICATION",
"NOSUPERUSER", "RENAME TO", "REPLICATION", "RESET", "SET",
- "SUPERUSER", "UNENCRYPTED", "VALID UNTIL", NULL};
+ "SUPERUSER", "UNENCRYPTED", "VALID UNTIL", NULL};
COMPLETE_WITH_LIST(list_ALTERUSER_WITH);
}
@@ -2017,7 +2017,7 @@ psql_completion(char *text, int start, int end)
"ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOCREATEDB",
"NOCREATEROLE", "NOCREATEUSER", "NOINHERIT", "NOLOGIN",
"NOREPLICATION", "NOSUPERUSER", "REPLICATION", "ROLE",
- "SUPERUSER", "SYSID", "UNENCRYPTED", "VALID UNTIL", NULL};
+ "SUPERUSER", "SYSID", "UNENCRYPTED", "VALID UNTIL", NULL};
COMPLETE_WITH_LIST(list_CREATEROLE_WITH);
}
@@ -2317,7 +2317,11 @@ psql_completion(char *text, int start, int end)
" UNION SELECT 'USAGE'"
" UNION SELECT 'ALL'");
}
- /* Complete GRANT/REVOKE <privilege> with "ON", GRANT/REVOKE <role> with TO/FROM */
+
+ /*
+ * Complete GRANT/REVOKE <privilege> with "ON", GRANT/REVOKE <role> with
+ * TO/FROM
+ */
else if (pg_strcasecmp(prev2_wd, "GRANT") == 0 ||
pg_strcasecmp(prev2_wd, "REVOKE") == 0)
{
@@ -2901,8 +2905,11 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* WITH [RECURSIVE] */
- /* Only match when WITH is the first word, as WITH may appear in many other
- contexts. */
+
+ /*
+ * Only match when WITH is the first word, as WITH may appear in many
+ * other contexts.
+ */
else if (pg_strcasecmp(prev_wd, "WITH") == 0 &&
prev2_wd[0] == '\0')
COMPLETE_WITH_CONST("RECURSIVE");
@@ -3029,7 +3036,7 @@ psql_completion(char *text, int start, int end)
strcmp(prev_wd, "\\e") == 0 || strcmp(prev_wd, "\\edit") == 0 ||
strcmp(prev_wd, "\\g") == 0 ||
strcmp(prev_wd, "\\i") == 0 || strcmp(prev_wd, "\\include") == 0 ||
- strcmp(prev_wd, "\\ir") == 0 || strcmp(prev_wd, "\\include_relative") == 0 ||
+ strcmp(prev_wd, "\\ir") == 0 || strcmp(prev_wd, "\\include_relative") == 0 ||
strcmp(prev_wd, "\\o") == 0 || strcmp(prev_wd, "\\out") == 0 ||
strcmp(prev_wd, "\\s") == 0 ||
strcmp(prev_wd, "\\w") == 0 || strcmp(prev_wd, "\\write") == 0
@@ -3412,8 +3419,11 @@ complete_from_list(const char *text, int state)
if (completion_case_sensitive)
return pg_strdup(item);
else
- /* If case insensitive matching was requested initially, adjust
- * the case according to setting. */
+
+ /*
+ * If case insensitive matching was requested initially,
+ * adjust the case according to setting.
+ */
return pg_strdup_keyword_case(item, text);
}
}
@@ -3451,8 +3461,11 @@ complete_from_const(const char *text, int state)
if (completion_case_sensitive)
return pg_strdup(completion_charp);
else
- /* If case insensitive matching was requested initially, adjust the
- * case according to setting. */
+
+ /*
+ * If case insensitive matching was requested initially, adjust
+ * the case according to setting.
+ */
return pg_strdup_keyword_case(completion_charp, text);
}
else
@@ -3500,7 +3513,7 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
}
varnames[nvars] = NULL;
- COMPLETE_WITH_LIST_CS((const char * const *) varnames);
+ COMPLETE_WITH_LIST_CS((const char *const *) varnames);
for (i = 0; i < nvars; i++)
free(varnames[i]);
@@ -3567,9 +3580,10 @@ complete_from_files(const char *text, int state)
static char *
pg_strdup_keyword_case(const char *s, const char *ref)
{
- char *ret, *p;
+ char *ret,
+ *p;
unsigned char first = ref[0];
- int tocase;
+ int tocase;
const char *varval;
varval = GetVariable(pset.vars, "COMP_KEYWORD_CASE");
@@ -3635,7 +3649,7 @@ exec_query(const char *query)
/*
- * Return the nwords word(s) before point. Words are returned right to left,
+ * Return the nwords word(s) before point. Words are returned right to left,
* that is, previous_words[0] gets the last word before point.
* If we run out of words, remaining array elements are set to empty strings.
* Each array element is filled with a malloc'd string.
diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c
index 33d08176d0..5e41efc5bd 100644
--- a/src/bin/psql/variables.c
+++ b/src/bin/psql/variables.c
@@ -15,7 +15,7 @@
* Check whether a variable's name is allowed.
*
* We allow any non-ASCII character, as well as ASCII letters, digits, and
- * underscore. Keep this in sync with the definition of variable_char in
+ * underscore. Keep this in sync with the definition of variable_char in
* psqlscan.l.
*/
static bool
diff --git a/src/bin/scripts/clusterdb.c b/src/bin/scripts/clusterdb.c
index 0f711e870b..76de70b6ef 100644
--- a/src/bin/scripts/clusterdb.c
+++ b/src/bin/scripts/clusterdb.c
@@ -112,9 +112,9 @@ main(int argc, char *argv[])
}
}
- /*
- * Non-option argument specifies database name
- * as long as it wasn't already specified with -d / --dbname
+ /*
+ * Non-option argument specifies database name as long as it wasn't
+ * already specified with -d / --dbname
*/
if (optind < argc && dbname == NULL)
{
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index 5406a98c83..0ae708b21e 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -185,7 +185,7 @@ connectMaintenanceDatabase(const char *maintenance_db, const char *pghost,
enum trivalue prompt_password,
const char *progname)
{
- PGconn *conn;
+ PGconn *conn;
/* If a maintenance database name was specified, just connect to it. */
if (maintenance_db)
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index 229b8dc596..854bc2f03a 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -10,8 +10,8 @@
#define COMMON_H
#include "libpq-fe.h"
-#include "getopt_long.h" /* pgrminclude ignore */
-#include "pqexpbuffer.h" /* pgrminclude ignore */
+#include "getopt_long.h" /* pgrminclude ignore */
+#include "pqexpbuffer.h" /* pgrminclude ignore */
enum trivalue
{
@@ -34,8 +34,8 @@ extern PGconn *connectDatabase(const char *dbname, const char *pghost,
bool fail_ok);
extern PGconn *connectMaintenanceDatabase(const char *maintenance_db,
- const char *pghost, const char *pgport, const char *pguser,
- enum trivalue prompt_password, const char *progname);
+ const char *pghost, const char *pgport, const char *pguser,
+ enum trivalue prompt_password, const char *progname);
extern PGresult *executeQuery(PGconn *conn, const char *query,
const char *progname, bool echo);
diff --git a/src/bin/scripts/createlang.c b/src/bin/scripts/createlang.c
index cc671a4976..8268eda6ed 100644
--- a/src/bin/scripts/createlang.c
+++ b/src/bin/scripts/createlang.c
@@ -92,10 +92,9 @@ main(int argc, char *argv[])
}
/*
- * We set dbname from positional arguments if it is not
- * already set by option arguments -d. If not doing
- * listlangs, positional dbname must follow positional
- * langname.
+ * We set dbname from positional arguments if it is not already set by
+ * option arguments -d. If not doing listlangs, positional dbname must
+ * follow positional langname.
*/
if (argc - optind > 0)
diff --git a/src/bin/scripts/dropdb.c b/src/bin/scripts/dropdb.c
index 444dce500e..10ed67df8b 100644
--- a/src/bin/scripts/dropdb.c
+++ b/src/bin/scripts/dropdb.c
@@ -21,7 +21,7 @@ static void help(const char *progname);
int
main(int argc, char *argv[])
{
- static int if_exists = 0;
+ static int if_exists = 0;
static struct option long_options[] = {
{"host", required_argument, NULL, 'h'},
@@ -129,7 +129,7 @@ main(int argc, char *argv[])
maintenance_db = "template1";
conn = connectMaintenanceDatabase(maintenance_db,
- host, port, username, prompt_password, progname);
+ host, port, username, prompt_password, progname);
if (echo)
printf("%s", sql.data);
diff --git a/src/bin/scripts/droplang.c b/src/bin/scripts/droplang.c
index 47ec37f5e9..74553c19fd 100644
--- a/src/bin/scripts/droplang.c
+++ b/src/bin/scripts/droplang.c
@@ -91,10 +91,9 @@ main(int argc, char *argv[])
}
/*
- * We set dbname from positional arguments if it is not
- * already set by option arguments -d. If not doing
- * listlangs, positional dbname must follow positional
- * langname.
+ * We set dbname from positional arguments if it is not already set by
+ * option arguments -d. If not doing listlangs, positional dbname must
+ * follow positional langname.
*/
if (argc - optind > 0)
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index 614a6885a0..35254f20cb 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -122,9 +122,9 @@ main(int argc, char *argv[])
}
}
- /*
- * Non-option argument specifies database name
- * as long as it wasn't already specified with -d / --dbname
+ /*
+ * Non-option argument specifies database name as long as it wasn't
+ * already specified with -d / --dbname
*/
if (optind < argc && dbname == NULL)
{
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index fe303ad885..6221bdc30d 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -135,10 +135,10 @@ main(int argc, char *argv[])
}
}
-
- /*
- * Non-option argument specifies database name
- * as long as it wasn't already specified with -d / --dbname
+
+ /*
+ * Non-option argument specifies database name as long as it wasn't
+ * already specified with -d / --dbname
*/
if (optind < argc && dbname == NULL)
{
@@ -312,7 +312,7 @@ vacuum_all_databases(bool full, bool verbose, bool and_analyze, bool analyze_onl
int i;
conn = connectMaintenanceDatabase(maintenance_db, host, port,
- username, prompt_password, progname);
+ username, prompt_password, progname);
result = executeQuery(conn, "SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;", progname, echo);
PQfinish(conn);