Re: Extending amcheck to check toast size and compression

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Aleksander Alekseev <aleksander@timescale.com>, pgsql-hackers@lists.postgresql.org
Date: 2021-07-14T10:33:59Z
Lists: pgsql-hackers
> @@ -30,6 +30,9 @@ PG_FUNCTION_INFO_V1(verify_heapam);
>  /* The number of columns in tuples returned by verify_heapam */
>  #define HEAPCHECK_RELATION_COLS 4
>  
> +/* The largest valid toast va_rawsize */
> +#define VARLENA_SIZE_LIMIT 0x3FFFFFFF
> +

Hmm, a toasted datum cannot be larger than MaxAllocSize, because it's 
reconstituted in a palloc'd datum, right?

- Heikki



Commits

  1. Remove tests added by bd807be6935929bdefe74d1258ca08048f0aafa3.

  2. amcheck: Add additional TOAST pointer checks.