demos_kratos
demos_kratos

Reputation: 96

How is it possible for QuerySet.count() to return non-zero values but for list(QuerySet.all()) to yield an empty list?

I am running a script using django-extensions and here is the paused execution of it.

illustrating the problem

How is this possible?

I am running Django 2.2.1 on Windows with a local postgres instance. The database itself was restored using psql from a dump created with pg_dump | gzip. There is another database, which was restored using pgAdmin from a custom format file, on which the code works fine, so I guess I messed up the restoration, but how?

Upvotes: 1

Views: 138

Answers (1)

demos_kratos
demos_kratos

Reputation: 96

Issue got fixed after recreating the backup with options --format=c --blobs --section=pre-data --section=data --section=post-data.

Upvotes: 1

Related Questions