Fix incorrect ALTER TABLE statement for columns in the instepctor.

Was caused by incorrect condition for determining the use of IDENTITY.
This commit is contained in:
eelke 2019-08-19 19:44:07 +02:00
parent b3352b8496
commit b939916b07
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ QString PgAttribute::columnDefinition(const PgDatabaseCatalog &cat) const
if (hasdef) if (hasdef)
sql += " DEFAULT " % defaultValue; sql += " DEFAULT " % defaultValue;
if (identity != ' ') { if (identity != '\0') {
sql += " GENERATED "; sql += " GENERATED ";
if (identity == 'a') sql += "ALWAYS"; if (identity == 'a') sql += "ALWAYS";
else if (identity == 'd') sql += "BY DEFAULT"; else if (identity == 'd') sql += "BY DEFAULT";

View file

@ -22,7 +22,7 @@ public:
int32_t typmod = -1; int32_t typmod = -1;
bool notnull = false; bool notnull = false;
bool hasdef = false; bool hasdef = false;
char identity = ' '; char identity = '\0';
bool isdropped = false; bool isdropped = false;
bool islocal = true; bool islocal = true;
Oid collation = InvalidOid; Oid collation = InvalidOid;