|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.110.2.3 1999/08/25 12:01:45 ishii Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.110.2.4 2000/01/04 17:27:26 tgl Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -2405,10 +2405,21 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
|
2405 | 2405 | stup=heap_formtuple(sd->rd_att,values,nulls);
|
2406 | 2406 |
|
2407 | 2407 | /* ----------------
|
2408 |
| - *insert the tuple in the relation and get the tuple's oid. |
| 2408 | + *Watch out for oversize tuple, which can happen if |
| 2409 | + *both of the saved data values are long. |
| 2410 | + *Our fallback strategy is just to not store the |
| 2411 | + *pg_statistic tuple at all in that case. (We could |
| 2412 | + *replace the values by NULLs and still store the |
| 2413 | + *numeric stats, but presently selfuncs.c couldn't |
| 2414 | + *do anything useful with that case anyway.) |
2409 | 2415 | * ----------------
|
2410 | 2416 | */
|
2411 |
| -heap_insert(sd,stup); |
| 2417 | +if (MAXALIGN(stup->t_len) <=MaxTupleSize) |
| 2418 | +{ |
| 2419 | +/* OK to store tuple */ |
| 2420 | +heap_insert(sd,stup); |
| 2421 | +} |
| 2422 | + |
2412 | 2423 | pfree(DatumGetPointer(values[3]));
|
2413 | 2424 | pfree(DatumGetPointer(values[4]));
|
2414 | 2425 | pfree(stup);
|
|