X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Ffield%2FPostgresField.php;h=53c3d335b1d5e8e18cebd69dc134003b66a08a82;hp=600f34a456f6e51f266efa67d8be13992546e2fb;hb=478a58f63101f2b47d18a618296b5e7970fa3f24;hpb=cf35ff756c89ca6d6e003b440076df5ebe7ccef7 diff --git a/includes/libs/rdbms/field/PostgresField.php b/includes/libs/rdbms/field/PostgresField.php index 600f34a456..53c3d335b1 100644 --- a/includes/libs/rdbms/field/PostgresField.php +++ b/includes/libs/rdbms/field/PostgresField.php @@ -38,30 +38,34 @@ AND attname=%s; SQL; $table = $db->remappedTableName( $table ); - $res = $db->query( - sprintf( $q, - $db->addQuotes( $db->getCoreSchema() ), - $db->addQuotes( $table ), - $db->addQuotes( $field ) - ) - ); - $row = $db->fetchObject( $res ); - if ( !$row ) { - return null; + foreach ( $db->getCoreSchemas() as $schema ) { + $res = $db->query( + sprintf( $q, + $db->addQuotes( $schema ), + $db->addQuotes( $table ), + $db->addQuotes( $field ) + ) + ); + $row = $db->fetchObject( $res ); + if ( !$row ) { + continue; + } + $n = new PostgresField; + $n->type = $row->typname; + $n->nullable = ( $row->attnotnull == 'f' ); + $n->name = $field; + $n->tablename = $table; + $n->max_length = $row->attlen; + $n->deferrable = ( $row->deferrable == 't' ); + $n->deferred = ( $row->deferred == 't' ); + $n->conname = $row->conname; + $n->has_default = ( $row->atthasdef === 't' ); + $n->default = $row->adsrc; + + return $n; } - $n = new PostgresField; - $n->type = $row->typname; - $n->nullable = ( $row->attnotnull == 'f' ); - $n->name = $field; - $n->tablename = $table; - $n->max_length = $row->attlen; - $n->deferrable = ( $row->deferrable == 't' ); - $n->deferred = ( $row->deferred == 't' ); - $n->conname = $row->conname; - $n->has_default = ( $row->atthasdef === 't' ); - $n->default = $row->adsrc; - return $n; + return null; } function name() {