<?php
class ControllerToolPostgr extends Controller{

    private $link;

    public function index(){

        //set_time_limit(-1);
        //ini_set('memory_limit', '2048MB');

        //$postgr = new \DB\Postgre('127.0.0.1', 'postgres', 'gHm9ds4!', '', '5432');
        $postgr = new \DB\Postgre('35.246.211.158', 'deecase', 'gHm9ds4!', '', '5432');

        var_dump($postgr); die();

        //$query = $postgr->query("SELECT * FROM ps_product LIMIT 1000 ")->rows;
        //var_dump($query);



        /*$products = $this->db->query("SELECT * FROM ps_product LIMIT 60000,70000 ")->rows;
        foreach ($products as $product){
            $sql = 'INSERT INTO ps_product VALUES(';
            $fields = array();
            $values = array();
            foreach ($product as $key => $p_item){
                $fields[] = '"'.$key.'"';
                if($key == 'date_available'){
                    $values[] = 'NULL';
                }else{
                    $values[] = $p_item ? ( is_numeric($p_item) ? $p_item : "'". $this->db->escape($p_item) ."'" ) : 'NULL';
                }

            }
            $sql .= implode(',', $values);
            $sql .= ')';



            //echo $sql; die();
            $postgr->query($sql);

            //var_dump($product); die();
        }*/



    }

}
