diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-08 21:21:18 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-08 21:21:18 +0000 |
commit | c00b309932b83e7c256a806223078f98d54f6cde (patch) | |
tree | 74fa1a0cbdb8d4bb4515167ffaed4964d8c32d05 /src/backend/nodes/print.c | |
parent | 4af3421161ce7847a019ec0799c898586574801f (diff) | |
download | postgresql-c00b309932b83e7c256a806223078f98d54f6cde.tar.gz postgresql-c00b309932b83e7c256a806223078f98d54f6cde.zip |
Alter string format used for integer and OID lists in stored rules.
This simplifies and speeds up the reader by letting it get the representation
right the first time, rather than correcting it after-the-fact. Also,
after int and OID lists become separate node types per Neil's pending
patch, this will let us treat these lists as just plain Nodes instead
of requiring separate read/write macros the way we have now.
Diffstat (limited to 'src/backend/nodes/print.c')
-rw-r--r-- | src/backend/nodes/print.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c index 074a8389023..14f73b1860e 100644 --- a/src/backend/nodes/print.c +++ b/src/backend/nodes/print.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.65 2003/11/29 19:51:49 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.66 2004/05/08 21:21:18 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -194,12 +194,20 @@ pretty_format_node_dump(const char *dump) } j = indentDist - 1; /* j will equal indentDist on next loop iteration */ + /* suppress whitespace just after } */ + while (dump[i+1] == ' ') + i++; break; case ')': - /* force line break after ')' */ - line[j + 1] = '\0'; - appendStringInfo(&str, "%s\n", line); - j = indentDist - 1; + /* force line break after ), unless another ) follows */ + if (dump[i+1] != ')') + { + line[j + 1] = '\0'; + appendStringInfo(&str, "%s\n", line); + j = indentDist - 1; + while (dump[i+1] == ' ') + i++; + } break; case '{': /* force line break before { */ |