From 902d1cb35f69464e1e13015b9e05abdb76a7444d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 2 Nov 2008 01:45:28 +0000 Subject: 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 --- src/backend/commands/trigger.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/commands/trigger.c') diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index ffdb168236f..53fb1995fc8 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.238 2008/10/24 23:42:35 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.239 2008/11/02 01:45:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ CreateTrigger(CreateTrigStmt *stmt, Oid constraintOid) int16 tgtype; int2vector *tgattr; Datum values[Natts_pg_trigger]; - char nulls[Natts_pg_trigger]; + bool nulls[Natts_pg_trigger]; Relation rel; AclResult aclresult; Relation tgrel; @@ -310,7 +310,7 @@ CreateTrigger(CreateTrigStmt *stmt, Oid constraintOid) /* * Build the new pg_trigger tuple. */ - memset(nulls, ' ', Natts_pg_trigger * sizeof(char)); + memset(nulls, false, sizeof(nulls)); values[Anum_pg_trigger_tgrelid - 1] = ObjectIdGetDatum(RelationGetRelid(rel)); values[Anum_pg_trigger_tgname - 1] = DirectFunctionCall1(namein, @@ -374,7 +374,7 @@ CreateTrigger(CreateTrigStmt *stmt, Oid constraintOid) tgattr = buildint2vector(NULL, 0); values[Anum_pg_trigger_tgattr - 1] = PointerGetDatum(tgattr); - tuple = heap_formtuple(tgrel->rd_att, values, nulls); + tuple = heap_form_tuple(tgrel->rd_att, values, nulls); /* force tuple to have the desired OID */ HeapTupleSetOid(tuple, trigoid); -- cgit v1.2.3