Remove useless if condition
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 29 Aug 2023 06:58:56 +0000 (08:58 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 29 Aug 2023 06:58:56 +0000 (08:58 +0200)
We can call GetAttributeCompression() with a NULL argument.  It
handles that internally already.  This change makes all the callers of
GetAttributeCompression() uniform.

Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/flat/52a125e4-ff9a-95f5-9f61-b87cf447e4da@eisentraut.org

src/backend/commands/tablecmds.c

index 48f17a340392e8723aaa5969b97d5b848f3f9821..d097da3c78e09b15d6196eb2eb4e391093ebaaae 100644 (file)
@@ -944,11 +944,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
 
                attr->attidentity = colDef->identity;
                attr->attgenerated = colDef->generated;
-
-               if (colDef->compression)
-                       attr->attcompression = GetAttributeCompression(attr->atttypid,
-                                                                                                                  colDef->compression);
-
+               attr->attcompression = GetAttributeCompression(attr->atttypid, colDef->compression);
                if (colDef->storage_name)
                        attr->attstorage = GetAttributeStorage(attr->atttypid, colDef->storage_name);
        }