Skip to content

Commit

Permalink
Don't assume pg_attribute.attgenerated will always have "s"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
espinafre authored and nyalldawson committed Jun 2, 2020
1 parent 5347759 commit fe3a8b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit fe3a8b1

Please sign in to comment.