summaryrefslogtreecommitdiff
path: root/src/backend/commands/comment.c
diff options
context:
space:
mode:
authorTom Lane2011-06-16 21:03:58 +0000
committerTom Lane2011-06-16 21:04:40 +0000
commitbfcb9328e51eaaa21c92a1f2d7262758afb843e8 (patch)
tree20a30f7595e14acd9840dedce9be50d742afb069 /src/backend/commands/comment.c
parent7357558fc8866e3a449aa9473c419b593d67b5b6 (diff)
Index tuple data arrays using Anum_xxx symbolic constants instead of "i++".
We had already converted most places to this style, but this patch gets the last few that were still doing it the old way. The main advantage is that this exposes a greppable name for each target column, rather than having to rely on comments (which a couple of places failed to provide anyhow). Richard Hopkins, additional work by me to clean up update_attstats() too
Diffstat (limited to 'src/backend/commands/comment.c')
-rw-r--r--src/backend/commands/comment.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index d09bef06824..587a689496f 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -157,11 +157,10 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
nulls[i] = false;
replaces[i] = true;
}
- i = 0;
- values[i++] = ObjectIdGetDatum(oid);
- values[i++] = ObjectIdGetDatum(classoid);
- values[i++] = Int32GetDatum(subid);
- values[i++] = CStringGetTextDatum(comment);
+ values[Anum_pg_description_objoid - 1] = ObjectIdGetDatum(oid);
+ values[Anum_pg_description_classoid - 1] = ObjectIdGetDatum(classoid);
+ values[Anum_pg_description_objsubid - 1] = Int32GetDatum(subid);
+ values[Anum_pg_description_description - 1] = CStringGetTextDatum(comment);
}
/* Use the index to search for a matching old tuple */
@@ -257,10 +256,9 @@ CreateSharedComments(Oid oid, Oid classoid, char *comment)
nulls[i] = false;
replaces[i] = true;
}
- i = 0;
- values[i++] = ObjectIdGetDatum(oid);
- values[i++] = ObjectIdGetDatum(classoid);
- values[i++] = CStringGetTextDatum(comment);
+ values[Anum_pg_shdescription_objoid - 1] = ObjectIdGetDatum(oid);
+ values[Anum_pg_shdescription_classoid - 1] = ObjectIdGetDatum(classoid);
+ values[Anum_pg_shdescription_description - 1] = CStringGetTextDatum(comment);
}
/* Use the index to search for a matching old tuple */