diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-11-02 01:45:28 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-11-02 01:45:28 +0000 |
commit | 902d1cb35f69464e1e13015b9e05abdb76a7444d (patch) | |
tree | 995e1ec29c8a937a3890956065a31c1ab9d7c6bd /src/backend/commands/analyze.c | |
parent | 492059dabae9643f097fcd0a4f8860366563843d (diff) | |
download | postgresql-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/analyze.c')
-rw-r--r-- | src/backend/commands/analyze.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 4b164aa7c5f..13a66e17e98 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.126 2008/10/31 15:05:00 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.127 2008/11/02 01:45:27 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1277,8 +1277,8 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) k, n; Datum values[Natts_pg_statistic]; - char nulls[Natts_pg_statistic]; - char replaces[Natts_pg_statistic]; + bool nulls[Natts_pg_statistic]; + bool replaces[Natts_pg_statistic]; /* Ignore attr if we weren't able to collect stats */ if (!stats->stats_valid) @@ -1289,8 +1289,8 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) */ for (i = 0; i < Natts_pg_statistic; ++i) { - nulls[i] = ' '; - replaces[i] = 'r'; + nulls[i] = false; + replaces[i] = true; } i = 0; @@ -1326,7 +1326,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) } else { - nulls[i] = 'n'; + nulls[i] = true; values[i++] = (Datum) 0; } } @@ -1346,7 +1346,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) } else { - nulls[i] = 'n'; + nulls[i] = true; values[i++] = (Datum) 0; } } @@ -1360,7 +1360,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) if (HeapTupleIsValid(oldtup)) { /* Yes, replace it */ - stup = heap_modifytuple(oldtup, + stup = heap_modify_tuple(oldtup, RelationGetDescr(sd), values, nulls, @@ -1371,7 +1371,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) else { /* No, insert new tuple */ - stup = heap_formtuple(RelationGetDescr(sd), values, nulls); + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); simple_heap_insert(sd, stup); } |