Don't assume pg_attribute.attgenerated will always have "s"

The value for pg_attribute.attgenerated will hold "s" for stored
generated fields, but this might change in future releases of
PostgreSQL. So, we just check for the presence of a value in that field.
This commit is contained in:
José de Paula Rodrigues Neto Assis 2020-05-25 10:25:01 -03:00 committed by Nyall Dawson
parent 5347759889
commit fe3a8b1565

View File

@ -920,7 +920,7 @@ bool QgsPostgresProvider::loadFields()
notNullMap[attrelid][attnum] = attNotNull;
uniqueMap[attrelid][attnum] = uniqueConstraint;
identityMap[attrelid][attnum] = attIdentity.isEmpty() ? " " : attIdentity;
generatedMap[attrelid][attnum] = attGenerated == "s" ? defVal : "";
generatedMap[attrelid][attnum] = attGenerated.isEmpty() ? "" : defVal;
}
}
}