From d1ae2324fdffc96004d8c3471accd9f98f4e1f33 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 14 May 2013 00:55:23 -0500 Subject: [PATCH] Fix returning check for Postgres. --- laravel/database/connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/database/connection.php b/laravel/database/connection.php index ec1ae884..5d2c2e11 100644 --- a/laravel/database/connection.php +++ b/laravel/database/connection.php @@ -197,7 +197,7 @@ public function query($sql, $bindings = array()) // For insert statements that use the "returning" clause, which is allowed // by database systems such as Postgres, we need to actually return the // real query result so the consumer can get the ID. - elseif (stripos($sql, 'insert') === 0 and stripos($sql, 'returning') !== false) + elseif (stripos($sql, 'insert') === 0 and stripos($sql, ') returning') !== false) { return $this->fetch($statement, Config::get('database.fetch')); }