changeset 247:70fae534b83a

fixed getItems select in pgsql_storage
author Goffi <goffi@goffi.org>
date Thu, 31 May 2012 00:24:20 +0200
parents 2a948abb77ed
children 50f6ee966da8
files sat_pubsub/pgsql_storage.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat_pubsub/pgsql_storage.py	Wed May 30 22:36:05 2012 +0200
+++ b/sat_pubsub/pgsql_storage.py	Thu May 31 00:24:20 2012 +0200
@@ -599,7 +599,7 @@
     def _getItems(self, cursor, maxItems):
         self._checkNodeExists(cursor)
         query = """SELECT data FROM nodes
-                   NATURAL JOIN items
+                   INNER  JOIN items USING (node_id)
                    WHERE node=%s ORDER BY date DESC"""
         if maxItems:
             cursor.execute(query + " LIMIT %s",
@@ -622,7 +622,7 @@
         items = []
         for itemIdentifier in itemIdentifiers:
             cursor.execute("""SELECT data FROM nodes
-                              NATURAL JOIN items
+                              INNER JOIN items USING (node_id)
                               WHERE node=%s AND item=%s""",
                            (self.nodeIdentifier,
                             itemIdentifier))