aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/analyze.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-04-06 04:21:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-04-06 04:21:44 +0000
commit3e23b68dac006e8deb0afa327e855258df8de064 (patch)
treef5a555955dd954265dea1107e08dadd917714551 /src/backend/commands/analyze.c
parentd44163953c2ce74d6db9d9807e030a0a3b725da5 (diff)
downloadpostgresql-3e23b68dac006e8deb0afa327e855258df8de064.tar.gz
postgresql-3e23b68dac006e8deb0afa327e855258df8de064.zip
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
Diffstat (limited to 'src/backend/commands/analyze.c')
-rw-r--r--src/backend/commands/analyze.c6
1 files changed, 3 insertions, 3 deletions
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