How to restore database without re-write database and tables owner by using postgres

From: Cidy Long <cidy(dot)long(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: How to restore database without re-write database and tables owner by using postgres
Date: 2023-05-21 00:24:30
Message-ID: C35FABA3-0B31-43CD-B2F2-273CADEE026C@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi. Here.

I’m trying to restore multiple database backup tar files to new database server on PostgreSQL-15 by run command in shell script

/usr/pgsql-15/bin/pg_restore -v --no-owner --host=$h --port=$db_port --username=postgres --dbname=$db_name $db_tar_file

but I found, the restored database’s owner and its tables owner was replaced by connect user (super user——postgres).

I tired to find out How to keep the database and its table original owner, I don’t find any thing.

Please advise!

Cidy

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sandeep Thakkar 2023-05-21 03:38:03 Re: BUG #17934: Cannot run pgAdmin after upgrading from 15.2 to 15.3
Previous Message Tom Lane 2023-05-20 02:17:14 Re: ERROR: CREATE DATABASE cannot be executed within a pipeline