@@ -780,20 +780,7 @@ protected function findPrimaryKeyColumns($table) {
if(!$this->tableExists($table)){
returnFALSE;
}
// Fetch the 'indkey' column from 'pg_index' to figure out the order of the
// primary key.
// @todo Use 'array_position()' to be able to perform the ordering in SQL
// directly when 9.5 is the minimum PostgreSQL version.
$result=$this->connection->query("SELECT a.attname, i.indkey FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) WHERE i.indrelid = '{".$table."}'::regclass AND i.indisprimary")->fetchAllKeyed();
return$this->connection->query("SELECT array_position(i.indkey, a.attnum) AS position, a.attname FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) WHERE i.indrelid = '{".$table."}'::regclass AND i.indisprimary ORDER BY position")->fetchAllKeyed();