From cbabb1a24bf40e74363efbf0401ba8d37b8c9799 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 25 Dec 2013 14:57:44 -0500 Subject: Issue #2056363 by yched, Sweetchuck, chx: INSERT INTO table SELECT * FROM ... not supported. --- includes/database/pgsql/query.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'includes/database/pgsql') diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc index f3783a9ca..9902b1643 100644 --- a/includes/database/pgsql/query.inc +++ b/includes/database/pgsql/query.inc @@ -112,7 +112,8 @@ class InsertQuery_pgsql extends InsertQuery { // If we're selecting from a SelectQuery, finish building the query and // pass it back, as any remaining options are irrelevant. if (!empty($this->fromQuery)) { - return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') ' . $this->fromQuery; + $insert_fields_string = $insert_fields ? ' (' . implode(', ', $insert_fields) . ') ' : ' '; + return $comments . 'INSERT INTO {' . $this->table . '}' . $insert_fields_string . $this->fromQuery; } $query = $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') VALUES '; -- cgit v1.2.3