What does --no-owner mean in Postgres?

You have read a guide to doing Postgres exports or imports and seen --no-owner, this is what it means

In Postgres tools like pg_dump and pg_restore, you might see a code example that mentions --no-owner. Whilst I could read it said “no owner” I didn’t really know what that meant.

When you see --something or -s along with a command, this is a flag. Flags are used to tell the command how to act. A command with this flag is saying, “Do a Postgres thing, but remember, `–no-owner”.

If this flag isn’t set, then postgres will attribute anything it does to the owner of the original database, when importing and exporting, this could cause issues, so often we will say --no-owner.

When --no-owner is set, postgres will not output any commands that will try and set the ownerships, therefore you shouldn’t run into any issues with users not being the same between databases.

You might be wondering what does --no-acl mean too, don’t worry, we’ve got you!

Recent posts View all

Web DevProductivity

Keeping on top of website updates

Learn what website updates are, what they entail, why they are important, and how we can help

Freelancing

Getting the most out of your agency

Here are some tips based on years of working with, for, and as an agency on how to get the most out of any work you do.