Skip to content

Conversation

@croaky
Copy link
Contributor

@croaky croaky commented May 3, 2020

I noticed some output when restoring my database:

pg_restore: dropping TABLE geographic_areas
pg_restore: from TOC entry 266; 1259 16503 TABLE geographic_areas uf1mu7mdqgl0dj
pg_restore: error: could not execute query: ERROR:  table "geographic_areas" does not exist
Command was: DROP TABLE "public"."geographic_areas";

It looks like the source of the output was the --clean flag:

--clean
  Clean (drop) database objects before recreating them. (Unless
  --if-exists is used, this might generate some harmless error messages,
  if any objects were not present in the destination database.)

https://www.postgresql.org/docs/current/app-pgrestore.html

As the docs say, these errors are harmless, but noisy.

We don't need the --clean flag because the commands Parity runs were:

dropdb --if-exists "$db"
createdb "$db"
pg_restore tmp/latest.backup --verbose --clean --no-acl --no-owner --dbname "$db"

We've already dropped the whole database, so --clean is redundant.

I noticed some output when restoring my database:

```
pg_restore: dropping TABLE geographic_areas
pg_restore: from TOC entry 266; 1259 16503 TABLE geographic_areas uf1mu7mdqgl0dj
pg_restore: error: could not execute query: ERROR:  table "geographic_areas" does not exist
Command was: DROP TABLE "public"."geographic_areas";
```

It looks like the source of the output was the `--clean` flag:

```
--clean
  Clean (drop) database objects before recreating them. (Unless
  --if-exists is used, this might generate some harmless error messages,
  if any objects were not present in the destination database.)
```

https://www.postgresql.org/docs/current/app-pgrestore.html

As the docs say, these errors are harmless, but noisy.

We don't need the `--clean` flag because the commands Parity runs were:

```
dropdb --if-exists "$db"
createdb "$db"
pg_restore tmp/latest.backup --verbose --clean --no-acl --no-owner --dbname "$db"
```

We've already dropped the whole database, so `--clean` is redundant.
@geoffharcourt geoffharcourt merged commit 34aaf6b into thoughtbot:master Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants