diff --git a/pom.xml b/pom.xml
index ea31260..243e0cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.replicadb
ReplicaDB
- 0.6.0
+ 0.6.1
ReplicaDB
https://github.com/osalvador/ReplicaDB
@@ -108,7 +108,7 @@
-
+
diff --git a/src/main/java/org/replicadb/manager/PostgresqlManager.java b/src/main/java/org/replicadb/manager/PostgresqlManager.java
index f345845..c69fc0c 100644
--- a/src/main/java/org/replicadb/manager/PostgresqlManager.java
+++ b/src/main/java/org/replicadb/manager/PostgresqlManager.java
@@ -169,7 +169,7 @@ public ResultSet readTable(String tableName, String[] columns, int nThread) thro
// Read table with source-query option specified
if (options.getSourceQuery() != null && !options.getSourceQuery().isEmpty()) {
sqlCmd = "SELECT * FROM (" +
- options.getSourceQuery() + ") OFFSET ? ";
+ options.getSourceQuery() + ") as T1 OFFSET ? ";
} else {
sqlCmd = "SELECT " +
@@ -284,7 +284,7 @@ public void preSourceTasks() throws SQLException {
// Source Query
if (options.getSourceQuery() != null && !options.getSourceQuery().isEmpty()) {
- sql = sql + "( " + this.options.getSourceQuery() + " )";
+ sql = sql + "( " + this.options.getSourceQuery() + " ) as T1";
} else {