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/outfuncs.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/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 788e7dc5afa..9139a9bec54 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.234 2004/05/06 14:01:33 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.235 2004/05/08 21:21:18 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -155,6 +155,7 @@ _outIntList(StringInfo str, List *list) List *l; appendStringInfoChar(str, '('); + appendStringInfoChar(str, 'i'); foreach(l, list) appendStringInfo(str, " %d", lfirsti(l)); appendStringInfoChar(str, ')'); @@ -170,6 +171,7 @@ _outOidList(StringInfo str, List *list) List *l; appendStringInfoChar(str, '('); + appendStringInfoChar(str, 'o'); foreach(l, list) appendStringInfo(str, " %u", lfirsto(l)); appendStringInfoChar(str, ')'); @@ -179,8 +181,9 @@ _outOidList(StringInfo str, List *list) * _outBitmapset - * converts a bitmap set of integers * - * Note: for historical reasons, the output is formatted exactly like - * an integer List would be. + * Note: the output format is "(b int int ...)", similar to an integer List. + * Currently bitmapsets do not appear in any node type that is stored in + * rules, so there is no support in readfuncs.c for reading this format. */ static void _outBitmapset(StringInfo str, Bitmapset *bms) @@ -189,6 +192,7 @@ _outBitmapset(StringInfo str, Bitmapset *bms) int x; appendStringInfoChar(str, '('); + appendStringInfoChar(str, 'b'); tmpset = bms_copy(bms); while ((x = bms_first_member(tmpset)) >= 0) appendStringInfo(str, " %d", x); |