Skip to content
Permalink
Browse files

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.
  • Loading branch information
espinafre authored and nyalldawson committed May 25, 2020
1 parent 5347759 commit fe3a8b1565ae2b0e1512c4737a15dcf8e9ce2382
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/postgres/qgspostgresprovider.cpp
@@ -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;
}
}
}

0 comments on commit fe3a8b1

Please sign in to comment.
You can’t perform that action at this time.