aboutsummaryrefslogtreecommitdiff
path: root/src/backend/lib
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-07-24 21:08:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-07-24 21:08:42 +0000
commit8af12bca3b19305e9219ce9c8230ed8003b870f6 (patch)
tree00f662171f5aac72b19b5e06a19a13678073a010 /src/backend/lib
parenta7e587863cab80b8896593f20b41e53d65155932 (diff)
downloadpostgresql-8af12bca3b19305e9219ce9c8230ed8003b870f6.tar.gz
postgresql-8af12bca3b19305e9219ce9c8230ed8003b870f6.zip
Assorted minor refactoring in EXPLAIN.
This is believed to not change the output at all, with one known exception: "Subquery Scan foo" becomes "Subquery Scan on foo". (We can fix that if anyone complains, but it would be a wart, because the old code was clearly inconsistent.) The main intention is to remove duplicate coding and provide a cleaner base for subsequent EXPLAIN patching. Robert Haas
Diffstat (limited to 'src/backend/lib')
-rw-r--r--src/backend/lib/stringinfo.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/backend/lib/stringinfo.c b/src/backend/lib/stringinfo.c
index 2fc4422a314..8d6c2483225 100644
--- a/src/backend/lib/stringinfo.c
+++ b/src/backend/lib/stringinfo.c
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/lib/stringinfo.c,v 1.50 2009/01/01 17:23:42 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/lib/stringinfo.c,v 1.51 2009/07/24 21:08:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -187,6 +187,26 @@ appendStringInfoChar(StringInfo str, char ch)
}
/*
+ * appendStringInfoSpaces
+ *
+ * Append the specified number of spaces to a buffer.
+ */
+void
+appendStringInfoSpaces(StringInfo str, int count)
+{
+ if (count > 0)
+ {
+ /* Make more room if needed */
+ enlargeStringInfo(str, count);
+
+ /* OK, append the spaces */
+ while (--count >= 0)
+ str->data[str->len++] = ' ';
+ str->data[str->len] = '\0';
+ }
+}
+
+/*
* appendBinaryStringInfo
*
* Append arbitrary binary data to a StringInfo, allocating more space