Skip to content

How to get a RAW SQL file using postgresql ? #456

Open
@pulse-mind

Description

@pulse-mind

Hi,

I am doing a postgresql backup on linux and I get a binary file. To restore it we need to use pg_restore.
I'd like to have a RAW SQL file where I can run a regular psql command.
How to do that ?

In the documentation it is written :

Postgres uses by default dbbackup.db.postgresql.PgDumpConnector, but we advise you to use dbbackup.db.postgresql.PgDumpBinaryConnector. The first one uses pg_dump and pqsl for its job, creating RAW SQL files.

The second uses pg_restore with binary dump files.

They can also use psql for launching administration command.

In the documentation it is written :

dbbackup.db.postgresql.PgDumpConnector for django.db.backends.postgresql

My database configuration is
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql',...

May be the documentation should be updated to say that

dbbackup.db.postgresql.PgDumpBinaryConnector for django.db.backends.postgresql

Which is probably the right thing:
https://github.com/jazzband/django-dbbackup/blob/master/dbbackup/db/base.py

Or ....?

Should I add

DBBACKUP_CONNECTOR_MAPPING = {
    'django.db.backends.postgresql': 'dbbackup.db.postgresql.PgDumpConnector',
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions