EntryDAOPGSQL.php 653 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. class FreshRSS_EntryDAOPGSQL extends FreshRSS_EntryDAOSQLite {
  3. public function sqlHexDecode($x) {
  4. return 'decode(' . $x . ", 'hex')";
  5. }
  6. public function sqlHexEncode($x) {
  7. return 'encode(' . $x . ", 'hex')";
  8. }
  9. protected function autoUpdateDb($errorInfo) {
  10. return false;
  11. }
  12. protected function addColumn($name) {
  13. return false;
  14. }
  15. public function size($all = true) {
  16. $db = FreshRSS_Context::$system_conf->db;
  17. $sql = 'SELECT pg_size_pretty(pg_database_size(?))';
  18. $values = array($db['base']);
  19. $stm = $this->bd->prepare($sql);
  20. $stm->execute($values);
  21. $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0);
  22. return $res[0];
  23. }
  24. }