mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Fix interaction of TOAST compression with expression indexes.
Before, trying to compress a value for insertion into an expression index would crash. Dilip Kumar, with some editing by me. Report by Jaime Casanova. Discussion: http://postgr.es/m/CAJKUy5gcs0zGOp6JXU2mMVdthYhuQpFk=S3V8DOKT=LZC1L36Q@mail.gmail.com
This commit is contained in:
@@ -220,10 +220,12 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
|
||||
|
||||
/*
|
||||
* If the BRIN summary and indexed attribute use the same data
|
||||
* type, we can use the same compression method. Otherwise we
|
||||
* have to use the default method.
|
||||
* type and it has a valid compression method, we can use the
|
||||
* same compression method. Otherwise we have to use the
|
||||
* default method.
|
||||
*/
|
||||
if (att->atttypid == atttype->type_id)
|
||||
if (att->atttypid == atttype->type_id &&
|
||||
CompressionMethodIsValid(att->attcompression))
|
||||
compression = att->attcompression;
|
||||
else
|
||||
compression = GetDefaultToastCompression();
|
||||
|
||||
Reference in New Issue
Block a user