title: PostgreSQL: relation does not exist error
body: <p>Perhaps this error can be caused by problems with the SCHEMA, I tried to fix it, but I was completely confused.</p>
  
  <p>Here is the detailed description.</p>
  
  <p>There is a separate file that runs the following commands:</p>
  
  <pre><code>CREATE DATABASE weather;
  CREATE SCHEMA public;
  CREATE SCHEMA schema1;
  
  SET search_path = schema1, public;
  
  CREATE TABLE "Sities" (
                      Id SERIAL PRIMARY KEY,
                      name TEXT,
                      country TEXT,
                      weather_id_api int);
  
  CREATE TABLE "Forecasts" (
                      Id SERIAL PRIMARY KEY,
                      city_id int,
                      time DATE,
                      temp INT,
                      humidity INT,
                      pressure INT);
  
  GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgres;
  GRANT usage ON SCHEMA public TO postgres;
  </code></pre>
  
  <p>The execution of each command is checked for errors. These commands are executed without problems.</p>
  
  <p>Further in another file such commands are executed:</p>
  
  <pre><code>SET search_path = schema1, public;
  INSERT INTO "Sities" (name, country, weather_id_api)
              SELECT 'Orenburg', "RU", 234234
              WHERE NOT EXISTS (SELECT name FROM "Sities" WHERE name="Orenburg");
  </code></pre>
  
  <p><strong>The last command causes an error:</strong></p>
  
  <blockquote>
    <p>panic: pq: Relation "Sities" does not exist</p>
    
    <p>goroutine 1 [running]: main.PostToDatabase(0x11731ee0)
            D:/Go/src/WeatherSoket/main.go:135 +0x40f main.Update()
            D:/Go/src/WeatherSoket/main.go:150 +0x52 main.main()
            D:/Go/src/WeatherSoket/main.go:165 +0xbe exit status 2</p>
  </blockquote>