diff options
author | Tom Lane | 2008-11-02 01:45:28 +0000 |
---|---|---|
committer | Tom Lane | 2008-11-02 01:45:28 +0000 |
commit | 902d1cb35f69464e1e13015b9e05abdb76a7444d (patch) | |
tree | 995e1ec29c8a937a3890956065a31c1ab9d7c6bd /src/backend/commands/tablespace.c | |
parent | 492059dabae9643f097fcd0a4f8860366563843d (diff) |
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/tablespace.c')
-rw-r--r-- | src/backend/commands/tablespace.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index c19eedcb6d5..b87ae345935 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.57 2008/06/19 00:46:04 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.58 2008/11/02 01:45:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -197,7 +197,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) #ifdef HAVE_SYMLINK Relation rel; Datum values[Natts_pg_tablespace]; - char nulls[Natts_pg_tablespace]; + bool nulls[Natts_pg_tablespace]; HeapTuple tuple; Oid tablespaceoid; char *location; @@ -278,7 +278,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) */ rel = heap_open(TableSpaceRelationId, RowExclusiveLock); - MemSet(nulls, ' ', Natts_pg_tablespace); + MemSet(nulls, false, sizeof(nulls)); values[Anum_pg_tablespace_spcname - 1] = DirectFunctionCall1(namein, CStringGetDatum(stmt->tablespacename)); @@ -286,9 +286,9 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) ObjectIdGetDatum(ownerId); values[Anum_pg_tablespace_spclocation - 1] = CStringGetTextDatum(location); - nulls[Anum_pg_tablespace_spcacl - 1] = 'n'; + nulls[Anum_pg_tablespace_spcacl - 1] = true; - tuple = heap_formtuple(rel->rd_att, values, nulls); + tuple = heap_form_tuple(rel->rd_att, values, nulls); tablespaceoid = simple_heap_insert(rel, tuple); @@ -845,8 +845,8 @@ AlterTableSpaceOwner(const char *name, Oid newOwnerId) if (spcForm->spcowner != newOwnerId) { Datum repl_val[Natts_pg_tablespace]; - char repl_null[Natts_pg_tablespace]; - char repl_repl[Natts_pg_tablespace]; + bool repl_null[Natts_pg_tablespace]; + bool repl_repl[Natts_pg_tablespace]; Acl *newAcl; Datum aclDatum; bool isNull; @@ -870,10 +870,10 @@ AlterTableSpaceOwner(const char *name, Oid newOwnerId) * anyway. */ - memset(repl_null, ' ', sizeof(repl_null)); - memset(repl_repl, ' ', sizeof(repl_repl)); + memset(repl_null, false, sizeof(repl_null)); + memset(repl_repl, false, sizeof(repl_repl)); - repl_repl[Anum_pg_tablespace_spcowner - 1] = 'r'; + repl_repl[Anum_pg_tablespace_spcowner - 1] = true; repl_val[Anum_pg_tablespace_spcowner - 1] = ObjectIdGetDatum(newOwnerId); /* @@ -888,11 +888,11 @@ AlterTableSpaceOwner(const char *name, Oid newOwnerId) { newAcl = aclnewowner(DatumGetAclP(aclDatum), spcForm->spcowner, newOwnerId); - repl_repl[Anum_pg_tablespace_spcacl - 1] = 'r'; + repl_repl[Anum_pg_tablespace_spcacl - 1] = true; repl_val[Anum_pg_tablespace_spcacl - 1] = PointerGetDatum(newAcl); } - newtuple = heap_modifytuple(tup, RelationGetDescr(rel), repl_val, repl_null, repl_repl); + newtuple = heap_modify_tuple(tup, RelationGetDescr(rel), repl_val, repl_null, repl_repl); simple_heap_update(rel, &newtuple->t_self, newtuple); CatalogUpdateIndexes(rel, newtuple); |