title: postgresql with pgbouncer tables not showing
body: <p>I tried implementing <code>pgbouncer</code> and found unusual behavior that I cannot solve.</p>
  <p>Here is my implementation using <code>docker</code>.</p>
  <pre><code>version: '3.5'
  
  services:
    dev8_web:
      container_name: dev8_web_1
  
      image: xcgd/odoo:8.0
  
      depends_on:
          - dev8_pgbouncer
  
      restart: unless-stopped
  
      command: &quot;start&quot;
  
    dev8_pgbouncer:
      container_name: dev8_pgbouncer_1
  
      depends_on:
        - dev8_db
      restart: unless-stopped
      image: pgbouncer/pgbouncer
  
      env_file:
        - env/pgbouncer.env
  
    dev8_db:
      container_name: dev8_db_1
  
      image: postgres:12.7
  
      restart: unless-stopped
  
      volumes:
        - ./db:/var/lib/postgresql/data
  
      environment:
        - POSTGRES_PASSWORD=odoo
        - POSTGRES_USER=odoo
        - POSTGRES_DB=postgres # Leave this set to postgres
  </code></pre>
  <p>Here is my <code>pgbouncer.env</code></p>
  <pre><code>DATABASES_HOST=dev8_db
  DATABASES_PORT=5432
  DATABASES_USER=odoo
  DATABASES_PASSWORD=odoo
  DATABASES_DBNAME=postgres
  </code></pre>
  <p>Here is my <code>odoo.conf</code> application configuration file</p>
  <pre><code># -*- coding: ascii -*-
  
  [options]
  
  admin_passwd = top-secret-password
  
  # |--------------------------------------------------------------------------
  # | Port Options
  # |--------------------------------------------------------------------------
  # |
  # | Define the application port and longpolling ports.
  # |
  
  xmlrpc_port = 8069
  
  # |--------------------------------------------------------------------------
  # | Database Configurations
  # |--------------------------------------------------------------------------
  # |
  # | Database configurations that setup Odoo to connect to a
  # | postgresql database.
  # |
  
  db_host = dev8_pgbouncer
  db_user = odoo
  db_password = odoo
  db_port = 6432
  
  addons_path = /opt/odoo/sources/odoo/addons,/mnt/logic-addons,/mnt/data-addons
  
  proxy_mode = True
  </code></pre>
  <p><strong>Issues I have encountered</strong></p>
  <p>When I created a database and initialized the database (created all the necessary tables for the application) everything works as intended.</p>
  <p>Things start getting weird when I tried to delete the database. The database was deleted, I can no longer see it in <code>psql \l</code>. But when I tried to create a new database using the same name with the previous database, I got all the previous tables without even having to initialize.</p>
  <p>And I got all the previous data inside the tables too.</p>
  <p>In further inspection I checked the database size using <code>psql \l+</code> it showed only 8MB.</p>
  <p>And when I tried to display all tables inside the database using <code>psql \dt</code> it says</p>
  <blockquote>
  <p>No relations found</p>
  </blockquote>
  <p>I have checked the schema and I only have public schema.</p>
  <p>In an implementation without <code>pgbouncer</code> the size of an initialized database should be a little over 100MB.</p>
  <p>I tried checking the <code>postgresql</code> data folder and it is located correctly in the volume I mounted.</p>
  <p>Can anyone explain why this issue occurred and how can I have a transparent <code>pgbouncer</code> implementation without having this issue?</p>