--TEST-- Pdo\Pgsql connect through PDO::connect --EXTENSIONS-- pdo_pgsql --SKIPIF-- --FILE-- exec('CREATE TABLE pdopgsql_002(id INT NOT NULL PRIMARY KEY, name VARCHAR(10))'); $db->exec("INSERT INTO pdopgsql_002 VALUES(1, 'A'), (2, 'B'), (3, 'C')"); foreach ($db->query('SELECT name FROM pdopgsql_002') as $row) { var_dump($row); } echo "Fin."; ?> --CLEAN-- query("DROP TABLE IF EXISTS pdopgsql_002"); ?> --EXPECT-- array(2) { ["name"]=> string(1) "A" [0]=> string(1) "A" } array(2) { ["name"]=> string(1) "B" [0]=> string(1) "B" } array(2) { ["name"]=> string(1) "C" [0]=> string(1) "C" } Fin.