diff options
Diffstat (limited to 'includes/database/pgsql/query.inc')
-rw-r--r-- | includes/database/pgsql/query.inc | 3 |
1 files changed, 2 insertions, 1 deletions
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 '; |