Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0zK2-0006UN-4r for pgsql-bugs@arkaria.postgresql.org; Mon, 22 May 2023 06:47:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q0zK1-0003ap-1F for pgsql-bugs@arkaria.postgresql.org; Mon, 22 May 2023 06:47:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0WsV-00041C-Tr for pgsql-bugs@lists.postgresql.org; Sun, 21 May 2023 00:24:52 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q0WsS-0014jW-Gk for pgsql-bugs@lists.postgresql.org; Sun, 21 May 2023 00:24:51 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1ae3ed1b08eso46562745ad.0 for ; Sat, 20 May 2023 17:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684628687; x=1687220687; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=y/H27aqLboerCs6p6arEXCe9zSMeUpvPpVYcN+70Uw4=; b=qFEpEt6o+XYA8UnVEjvemigCquvLxH8dHpAamSCwtAlPIcb3bKv2B4CkMVuff0WPtU 81SY7g+YwltkPAsNRJ+rl73UvzLSWCetG8eKfGrTSzrJhhcfzZMfoNAcv0HiScXxklHu onAhoXLqrjLr6LXdt+Px3BJ+ksi5CNefNrgd+UwD1bnf95NWSL5b5JBzBYTVHZ/F+kRe 3L20PeyRYSnGqztsIax0SUGwMqHpW9lBYEU2HVNW37R4rAh7ql2qu81boep7Nqb/hIcs 1VMZ/59a1KriOYYrZa3vmGqQQNQnXrCc5+s20lRpqi8Clu8TzAA8D0cayoC5+qnKyt5w OWnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684628687; x=1687220687; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=y/H27aqLboerCs6p6arEXCe9zSMeUpvPpVYcN+70Uw4=; b=gtrtnWvUJ683u430NhFI6yV5QVbzgYu9ymHWUh5ojq/Bcol7CiVntRa2cH6KkoEt3K bE8U7mixEH8CPQITDgh7HqBith3FSfMfDkDOW+u40cycqtwggNZ+be77CIXwqR1I4g8n hmuYyY/AonIUoHCxFwLkyR66JZw5XM6CbKGLOwOEyiVcH1TwjwHrpBeeBBwxmgkDMhom poYtl+28SRXRlA1THq7DTWahZM1IbL+Ijplf+pEg4td15WpUJrQxKjUYplH8gkOHrzXP jkNXZb8G2pUYwfWT2KJXhDdTeZqX+8pkr9unZ+mHW/0k0fFrCfGlcLeyow7lzUTbh6l2 +xlw== X-Gm-Message-State: AC+VfDxueHeUj1q7N7qPtVaJ1yAxgvwtlWz4POCRVL51bvuMbAbMEWKC rImfrB2GNayPwwWJfoNPYSwM6lhsf4k= X-Google-Smtp-Source: ACHHUZ4QxvDFmtNmAWO28myIIBacY1SY/Tz1zHiDWUldnIODXzcURj22za6XogR0EOzk48G6eKZU9g== X-Received: by 2002:a17:903:22c1:b0:1a5:167f:620f with SMTP id y1-20020a17090322c100b001a5167f620fmr8842460plg.15.1684628687342; Sat, 20 May 2023 17:24:47 -0700 (PDT) Received: from smtpclient.apple (static-n58-105-165-126.mas4.nsw.optusnet.com.au. [58.105.165.126]) by smtp.gmail.com with ESMTPSA id g2-20020a170902740200b001ac84f87b1dsm2075231pll.155.2023.05.20.17.24.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 May 2023 17:24:47 -0700 (PDT) From: Cidy Long Content-Type: multipart/alternative; boundary="Apple-Mail=_02648026-BAB0-4C46-8FBF-12118B25A609" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: How to restore database without re-write database and tables owner by using postgres Message-Id: Date: Sun, 21 May 2023 10:24:30 +1000 To: pgsql-bugs@lists.postgresql.org X-Mailer: Apple Mail (2.3731.500.231) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_02648026-BAB0-4C46-8FBF-12118B25A609 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi. Here. I=E2=80=99m 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=3D$h = --port=3D$db_port --username=3Dpostgres --dbname=3D$db_name $db_tar_file but I found, the restored database=E2=80=99s owner and its tables owner = was replaced by connect user (super user=E2=80=94=E2=80=94postgres). I tired to find out How to keep the database and its table original = owner, I don=E2=80=99t find any thing. Please advise! Cidy= --Apple-Mail=_02648026-BAB0-4C46-8FBF-12118B25A609 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi. = Here.

I=E2=80=99m 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=3D$h --port=3D$db_port --username=3Dpostgres --dbname=3D$db_name $db_tar_file

but I found, the = restored database=E2=80=99s owner and its tables owner was replaced by = connect user (super user=E2=80=94=E2=80=94postgres).

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

Please = advise!

Cidy
= --Apple-Mail=_02648026-BAB0-4C46-8FBF-12118B25A609--