aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/comment.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-11-02 01:45:28 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-11-02 01:45:28 +0000
commit902d1cb35f69464e1e13015b9e05abdb76a7444d (patch)
tree995e1ec29c8a937a3890956065a31c1ab9d7c6bd /src/backend/commands/comment.c
parent492059dabae9643f097fcd0a4f8860366563843d (diff)
downloadpostgresql-902d1cb35f69464e1e13015b9e05abdb76a7444d.tar.gz
postgresql-902d1cb35f69464e1e13015b9e05abdb76a7444d.zip
Remove all uses of the deprecated functions heap_formtuple, heap_modifytuple,
and heap_deformtuple in favor of the newer functions heap_form_tuple et al (which do the same things but use bool control flags instead of arbitrary char values). Eliminate the former duplicate coding of these functions, reducing the deprecated functions to mere wrappers around the newer ones. We can't get rid of them entirely because add-on modules probably still contain many instances of the old coding style. Kris Jurka
Diffstat (limited to 'src/backend/commands/comment.c')
-rw-r--r--src/backend/commands/comment.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index 7172b8638c1..4f3e5c82c40 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -7,7 +7,7 @@
* Copyright (c) 1996-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.104 2008/10/21 10:38:51 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.105 2008/11/02 01:45:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -197,8 +197,8 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
HeapTuple oldtuple;
HeapTuple newtuple = NULL;
Datum values[Natts_pg_description];
- char nulls[Natts_pg_description];
- char replaces[Natts_pg_description];
+ bool nulls[Natts_pg_description];
+ bool replaces[Natts_pg_description];
int i;
/* Reduce empty-string to NULL case */
@@ -210,8 +210,8 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
{
for (i = 0; i < Natts_pg_description; i++)
{
- nulls[i] = ' ';
- replaces[i] = 'r';
+ nulls[i] = false;
+ replaces[i] = true;
}
i = 0;
values[i++] = ObjectIdGetDatum(oid);
@@ -248,7 +248,7 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
simple_heap_delete(description, &oldtuple->t_self);
else
{
- newtuple = heap_modifytuple(oldtuple, RelationGetDescr(description), values,
+ newtuple = heap_modify_tuple(oldtuple, RelationGetDescr(description), values,
nulls, replaces);
simple_heap_update(description, &oldtuple->t_self, newtuple);
}
@@ -262,7 +262,7 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
if (newtuple == NULL && comment != NULL)
{
- newtuple = heap_formtuple(RelationGetDescr(description),
+ newtuple = heap_form_tuple(RelationGetDescr(description),
values, nulls);
simple_heap_insert(description, newtuple);
}
@@ -297,8 +297,8 @@ CreateSharedComments(Oid oid, Oid classoid, char *comment)
HeapTuple oldtuple;
HeapTuple newtuple = NULL;
Datum values[Natts_pg_shdescription];
- char nulls[Natts_pg_shdescription];
- char replaces[Natts_pg_shdescription];
+ bool nulls[Natts_pg_shdescription];
+ bool replaces[Natts_pg_shdescription];
int i;
/* Reduce empty-string to NULL case */
@@ -310,8 +310,8 @@ CreateSharedComments(Oid oid, Oid classoid, char *comment)
{
for (i = 0; i < Natts_pg_shdescription; i++)
{
- nulls[i] = ' ';
- replaces[i] = 'r';
+ nulls[i] = false;
+ replaces[i] = true;
}
i = 0;
values[i++] = ObjectIdGetDatum(oid);
@@ -343,7 +343,7 @@ CreateSharedComments(Oid oid, Oid classoid, char *comment)
simple_heap_delete(shdescription, &oldtuple->t_self);
else
{
- newtuple = heap_modifytuple(oldtuple, RelationGetDescr(shdescription),
+ newtuple = heap_modify_tuple(oldtuple, RelationGetDescr(shdescription),
values, nulls, replaces);
simple_heap_update(shdescription, &oldtuple->t_self, newtuple);
}
@@ -357,7 +357,7 @@ CreateSharedComments(Oid oid, Oid classoid, char *comment)
if (newtuple == NULL && comment != NULL)
{
- newtuple = heap_formtuple(RelationGetDescr(shdescription),
+ newtuple = heap_form_tuple(RelationGetDescr(shdescription),
values, nulls);
simple_heap_insert(shdescription, newtuple);
}