mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Error on invalid TOAST compression in CREATE or ALTER TABLE.
The previous coding treated an invalid compression method name as equivalent to the default, which is certainly not right. Justin Pryzby Discussion: http://postgr.es/m/20210321235544.GD4203@telsasoft.com
This commit is contained in:
@ -17863,9 +17863,13 @@ GetAttributeCompression(Form_pg_attribute att, char *compression)
|
||||
|
||||
/* fallback to default compression if it's not specified */
|
||||
if (compression == NULL)
|
||||
cmethod = GetDefaultToastCompression();
|
||||
else
|
||||
cmethod = CompressionNameToMethod(compression);
|
||||
return GetDefaultToastCompression();
|
||||
|
||||
cmethod = CompressionNameToMethod(compression);
|
||||
if (!CompressionMethodIsValid(cmethod))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("invalid compression method \"%s\"", compression)));
|
||||
|
||||
return cmethod;
|
||||
}
|
||||
|
Reference in New Issue
Block a user