From 111163b48ef3668b36858b3dbd2da20838064f5e Mon Sep 17 00:00:00 2001 From: Lorien Gamaroff Date: Thu, 22 Nov 2012 14:49:19 +0200 Subject: [PATCH] Update lib/databases/postgresql.js Removing brackets which cause query to fail --- lib/databases/postgresql.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/databases/postgresql.js b/lib/databases/postgresql.js index 9e70c25..5aac1ae 100644 --- a/lib/databases/postgresql.js +++ b/lib/databases/postgresql.js @@ -147,7 +147,7 @@ DBClient.prototype.selectRecords = function (collection, config) { if (config.rel && config.rel.length) { for (var i = 0; i < config.rel.length; i++) { - query_tables = "(" + query_tables + ") JOIN " + + query_tables = query_tables + " JOIN " + this._escapeId(config.rel[i].collection) + " t" + (i + 1) + " ON " + this._escapeId("t" + i + "." + config.rel[i].rel[0]) + " = " + this._escapeId("t" + (i + 1) + "." + config.rel[i].rel[1]);