summaryrefslogtreecommitdiff
path: root/src/bin/psql
diff options
context:
space:
mode:
authorRobert Haas2016-06-09 22:02:36 +0000
committerRobert Haas2016-06-09 22:02:36 +0000
commit4bc424b968058c7f0aa685821d7039e86faac99c (patch)
treea4e245ae67bd11edb3926ff5fb3b0223438ac283 /src/bin/psql
parent9164deea2f4ac90ee5e008ff41fc5ad4423887b2 (diff)
pgindent run for 9.6
Diffstat (limited to 'src/bin/psql')
-rw-r--r--src/bin/psql/crosstabview.c14
-rw-r--r--src/bin/psql/help.c4
-rw-r--r--src/bin/psql/prompt.c3
-rw-r--r--src/bin/psql/tab-complete.c21
4 files changed, 27 insertions, 15 deletions
diff --git a/src/bin/psql/crosstabview.c b/src/bin/psql/crosstabview.c
index 1e838bb3135..cbe8ddff55a 100644
--- a/src/bin/psql/crosstabview.c
+++ b/src/bin/psql/crosstabview.c
@@ -80,7 +80,7 @@ typedef struct _avl_tree
static bool printCrosstab(const PGresult *results,
- int num_columns, pivot_field *piv_columns, int field_for_columns,
+ int num_columns, pivot_field *piv_columns, int field_for_columns,
int num_rows, pivot_field *piv_rows, int field_for_rows,
int field_for_data);
static void avlInit(avl_tree *tree);
@@ -285,7 +285,7 @@ error_return:
*/
static bool
printCrosstab(const PGresult *results,
- int num_columns, pivot_field *piv_columns, int field_for_columns,
+ int num_columns, pivot_field *piv_columns, int field_for_columns,
int num_rows, pivot_field *piv_rows, int field_for_rows,
int field_for_data)
{
@@ -396,10 +396,10 @@ printCrosstab(const PGresult *results,
if (cont.cells[idx] != NULL)
{
psql_error("\\crosstabview: query result contains multiple data values for row \"%s\", column \"%s\"\n",
- piv_rows[row_number].name ? piv_rows[row_number].name :
- popt.nullPrint ? popt.nullPrint : "(null)",
- piv_columns[col_number].name ? piv_columns[col_number].name :
- popt.nullPrint ? popt.nullPrint : "(null)");
+ piv_rows[row_number].name ? piv_rows[row_number].name :
+ popt.nullPrint ? popt.nullPrint : "(null)",
+ piv_columns[col_number].name ? piv_columns[col_number].name :
+ popt.nullPrint ? popt.nullPrint : "(null)");
goto error;
}
@@ -548,7 +548,7 @@ avlInsertNode(avl_tree *tree, avl_node **node, pivot_field field)
if (cmp != 0)
{
avlInsertNode(tree,
- cmp > 0 ? &current->children[1] : &current->children[0],
+ cmp > 0 ? &current->children[1] : &current->children[0],
field);
avlAdjustBalance(tree, node);
}
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 0d0461dc2a7..9e6d67b0ea9 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -85,8 +85,8 @@ usage(unsigned short int pager)
fprintf(output, _(" -f, --file=FILENAME execute commands from file, then exit\n"));
fprintf(output, _(" -l, --list list available databases, then exit\n"));
fprintf(output, _(" -v, --set=, --variable=NAME=VALUE\n"
- " set psql variable NAME to VALUE\n"
- " (e.g., -v ON_ERROR_STOP=1)\n"));
+ " set psql variable NAME to VALUE\n"
+ " (e.g., -v ON_ERROR_STOP=1)\n"));
fprintf(output, _(" -V, --version output version information, then exit\n"));
fprintf(output, _(" -X, --no-psqlrc do not read startup file (~/.psqlrc)\n"));
fprintf(output, _(" -1 (\"one\"), --single-transaction\n"
diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c
index 647e8712d6a..fb08d67390a 100644
--- a/src/bin/psql/prompt.c
+++ b/src/bin/psql/prompt.c
@@ -166,7 +166,8 @@ get_prompt(promptStatus_t status)
case 'p':
if (pset.db)
{
- int pid = PQbackendPID(pset.db);
+ int pid = PQbackendPID(pset.db);
+
if (pid)
snprintf(buf, sizeof(buf), "%d", pid);
}
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index cc10abc1c43..8de8a3d0f9c 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -1548,7 +1548,7 @@ psql_completion(const char *text, int start, int end)
/* ALTER SERVER <name> */
else if (Matches3("ALTER", "SERVER", MatchAny))
COMPLETE_WITH_LIST4("VERSION", "OPTIONS", "OWNER TO", "RENAME TO");
- /* ALTER SERVER <name> VERSION <version>*/
+ /* ALTER SERVER <name> VERSION <version> */
else if (Matches5("ALTER", "SERVER", MatchAny, "VERSION", MatchAny))
COMPLETE_WITH_CONST("OPTIONS");
/* ALTER SYSTEM SET, RESET, RESET ALL */
@@ -2030,8 +2030,11 @@ psql_completion(const char *text, int start, int end)
/* First off we complete CREATE UNIQUE with "INDEX" */
else if (TailMatches2("CREATE", "UNIQUE"))
COMPLETE_WITH_CONST("INDEX");
- /* If we have CREATE|UNIQUE INDEX, then add "ON", "CONCURRENTLY",
- and existing indexes */
+
+ /*
+ * If we have CREATE|UNIQUE INDEX, then add "ON", "CONCURRENTLY", and
+ * existing indexes
+ */
else if (TailMatches2("CREATE|UNIQUE", "INDEX"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,
" UNION SELECT 'ON'"
@@ -2040,7 +2043,11 @@ psql_completion(const char *text, int start, int end)
else if (TailMatches3("INDEX|CONCURRENTLY", MatchAny, "ON") ||
TailMatches2("INDEX|CONCURRENTLY", "ON"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tm, NULL);
- /* Complete CREATE|UNIQUE INDEX CONCURRENTLY with "ON" and existing indexes */
+
+ /*
+ * Complete CREATE|UNIQUE INDEX CONCURRENTLY with "ON" and existing
+ * indexes
+ */
else if (TailMatches3("CREATE|UNIQUE", "INDEX", "CONCURRENTLY"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,
" UNION SELECT 'ON'");
@@ -3226,6 +3233,7 @@ _complete_from_query(int is_schema_query, const char *text, int state)
static int list_index,
byte_length;
static PGresult *result = NULL;
+
/*
* If this is the first time for this completion, we fetch a list of our
* "things" from the backend.
@@ -3242,7 +3250,10 @@ _complete_from_query(int is_schema_query, const char *text, int state)
list_index = 0;
byte_length = strlen(text);
- /* Count length as number of characters (not bytes), for passing to substring */
+ /*
+ * Count length as number of characters (not bytes), for passing to
+ * substring
+ */
while (*pstr)
{
char_length++;