Add PostgreSQL support for LIMIT and oFFSET
authorJoey Schulze <joey@infodrom.org>
Wed, 20 Jan 2010 18:08:43 +0000 (19:08 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 20 Jan 2010 18:08:43 +0000 (19:08 +0100)
lib/rico/ricoXmlResponse.php

index 30575e3..33bd798 100644 (file)
@@ -82,6 +82,11 @@ class ricoXmlResponse {
         $totcnt=$this->Query2xmlRaw_Limit($this->sqltext, $offset, $numrows, 0);
         break;
 
+      case "PostgreSQL":
+        $this->sqltext=$this->oParse->UnparseSelect()." LIMIT ".($numrows + 1) . " OFFSET ".$offset;
+        $totcnt=$this->Query2xmlRaw_Limit($this->sqltext, $offset, $numrows, 0);
+        break;
+
       default:
         $this->sqltext=$this->oParse->UnparseSelect();
         $totcnt=$this->Query2xmlRaw($this->sqltext, $offset, $numrows);