From 3e23b68dac006e8deb0afa327e855258df8de064 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 6 Apr 2007 04:21:44 +0000 Subject: Support varlena fields with single-byte headers and unaligned storage. This commit breaks any code that assumes that the mere act of forming a tuple (without writing it to disk) does not "toast" any fields. While all available regression tests pass, I'm not totally sure that we've fixed every nook and cranny, especially in contrib. Greg Stark with some help from Tom Lane --- src/backend/commands/analyze.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/commands/analyze.c') diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c568f04284c..44e743363ad 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.103 2007/01/09 02:14:11 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.104 2007/04/06 04:21:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1478,7 +1478,7 @@ compute_minimal_stats(VacAttrStatsP stats, */ if (is_varlena) { - total_width += VARSIZE(DatumGetPointer(value)); + total_width += VARSIZE_ANY(DatumGetPointer(value)); /* * If the value is toasted, we want to detoast it just once to @@ -1792,7 +1792,7 @@ compute_scalar_stats(VacAttrStatsP stats, */ if (is_varlena) { - total_width += VARSIZE(DatumGetPointer(value)); + total_width += VARSIZE_ANY(DatumGetPointer(value)); /* * If the value is toasted, we want to detoast it just once to -- cgit v1.2.3