You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1792,7 +1757,8 @@ bool QgsPostgresProvider::parseDomainCheckConstraint( QStringList &enumValues, c
1792
1757
enumValues.clear();
1793
1758
1794
1759
//is it a domain type with a check constraint?
1795
-
QString domainSql = QStringLiteral( "SELECT domain_name, domain_schema FROM information_schema.columns WHERE table_name=%1 AND column_name=%2" ).arg( quotedValue( mTableName ), quotedValue( attributeName ) );
1760
+
QString domainSql = QStringLiteral( "SELECT domain_name,domain_schema FROM information_schema.columns WHERE table_schema=%1 AND table_name=%2 AND column_name=%3" )
if ( tableoid > 0 && PGRES_TUPLES_OK == result.PQresultStatus() )
3412
3378
{
3413
-
sql = QStringLiteral( "SELECT pg_namespace.nspname,pg_class.relname FROM pg_class,pg_namespace WHERE pg_class.relnamespace=pg_namespace.oid AND pg_class.oid=%1" ).arg( tableoid );
3379
+
sql = QStringLiteral( "SELECT pg_namespace.nspname,pg_class.relname FROM pg_class JOIN pg_namespace ON pg_class.relnamespace=pg_namespace.oid WHERE pg_class.oid=%1" ).arg( tableoid );
3414
3380
result = connectionRO()->PQexec( sql );
3415
3381
3416
3382
if ( PGRES_TUPLES_OK == result.PQresultStatus() && 1 == result.PQntuples() )
3417
3383
{
3418
3384
schemaName = result.PQgetvalue( 0, 0 );
3419
3385
tableName = result.PQgetvalue( 0, 1 );
3420
3386
3421
-
sql = QStringLiteral( "SELECT a.attname, t.typname FROM pg_attribute a, pg_type t WHERE a.attrelid=%1 AND a.attnum=%2 AND a.atttypid = t.oid" ).arg( tableoid ).arg( column );
3387
+
sql = QStringLiteral( "SELECT a.attname, t.typname FROM pg_attribute a JOIN pg_type t ON a.atttypid = t.oid WHERE a.attrelid=%1 AND a.attnum=%2" ).arg( tableoid ).arg( column );
3422
3388
result = connectionRO()->PQexec( sql );
3423
3389
if ( PGRES_TUPLES_OK == result.PQresultStatus() && 1 == result.PQntuples() )
1 commit comments
nyalldawson commentedon May 20, 2019
@jef-n I had to revert this in bf13d09 -- it broke the postgres unit tests