Skip to content

Commit

Permalink
Handling PostgreSQL <= 11.
Browse files Browse the repository at this point in the history
  • Loading branch information
espinafre authored and nyalldawson committed Jun 2, 2020
1 parent 80f1e36 commit fef79a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -908,7 +908,14 @@ bool QgsPostgresProvider::loadFields()
QString attGenerated = connectionRO()->pgVersion() >= 120000 ? fmtFieldTypeResult.PQgetvalue( i, 9 ) : " ";
fmtFieldTypeMap[attrelid][attnum] = formatType;
descrMap[attrelid][attnum] = descr;
defValMap[attrelid][attnum] = attGenerated.isEmpty() ? defVal : "DEFAULT";
if ( connectionRO()->pgVersion() >= 120000 )
{
defValMap[attrelid][attnum] = attGenerated.isEmpty() ? defVal : "DEFAULT";
}
else
{
defValMap[attrelid][attnum] = defVal;
}
attTypeIdMap[attrelid][attnum] = attType;
notNullMap[attrelid][attnum] = attNotNull;
uniqueMap[attrelid][attnum] = uniqueConstraint;
Expand Down

0 comments on commit fef79a0

Please sign in to comment.