Backing up PostgreSQL users and groups (pg_dump and pg_dumpall)

preview_player
Показать описание
The pg_dump utility is the first utility most Postgres users encounter when creating a backup. However, because the pg_dump utility is used to backup a single Postgres database, users and groups aren't included in the backup contents.

The solution to this issue is to first do a pg_dumpall using the -g option, which will backup global objects ... users and groups. This video demonstrates how to accomplish the backup of Postgres users and groups using pg_dumpall.
Рекомендации по теме
Комментарии
Автор

Really good, straight to the point and concise explanation of how to export a PostgreSQL DB!

KenSeedarnee
Автор

This was very helpful and calmly and clearly explained with high quality audio and video. Thank you SO much for that.

FrmanTV
Автор

Thanks, that's really helpful. Any plans to make a video covering how to create a backup from e.g a remote postgres running on AWS RDS onto a local backup machine?
I'm trying to understand how I could automate daily backups to my extra linux machine.

IMADETHISACCFORRAY
Автор

Buen video .. quiero sacar un backup y me sale el error ... Pg_dump: el esquema 2201 no existe... Portgresql-11.?

juancarlospastillo
Автор

So why use pg_dump at all if you can just use pg_dumpall without the -g parameter and have all the data and user objects in a single file?

wackogames
Автор

Well explained, thanks.
In some managed postgres DBs you can't run dumpall, because it needs super user permission.
How can I dump users in that case?

yehiamcp
Автор

So to recap: If I have a postgres instance with 1 self created DB and I want to export both the DB and all the users, I use pg_dumpall without the -g flag?
If I then import the dump file to a new postgres instance, will it overwrite the pre-existing default postgres schemes, i.e. information_schema, pg_catalog, pg_toast, public?

tornoutlaw
Автор

Very useful. Thanks. Do you offer PostgreSQL training?

vitache
Автор

Mine just refuses to produce the file on dump though. Frustrating af.

Hashterix
Автор

Hello Guys, I am an Oracle/SQL Server DBA. Currently I've a requirement for configuring postgresql database. Which am new to this environment and want to manage the database(Backup, Restore, Health Check, Alerts monitor). Kindly assist me on this

jayaprakashduraisamy