Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJRLl-0006w1-VJ for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Sep 2013 17:03:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VJRLl-0004ny-E7 for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Sep 2013 17:03:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJRLk-0004mv-1D for pgsql-bugs@postgresql.org; Tue, 10 Sep 2013 17:03:36 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJRLg-0001vy-JL for pgsql-bugs@postgresql.org; Tue, 10 Sep 2013 17:03:35 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id r8AH3Nl26540 for ; Tue, 10 Sep 2013 10:03:23 -0700 Message-ID: <522F50D8.5030202@hogranch.com> Date: Tue, 10 Sep 2013 10:03:20 -0700 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: Error by restore a database References: <42EBFBAC02A8479EBBC7D47042E08163@engineer> In-Reply-To: <42EBFBAC02A8479EBBC7D47042E08163@engineer> Content-Type: multipart/alternative; boundary="------------020303010002060806040304" X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------020303010002060806040304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 9/9/2013 11:38 PM, Sbis-Partner wrote: > > When you restore a database error occurs > > «Pg_restore: creating TABLE dbschema > > pg_restore: [archiver (db)] Error from TOC entry 1428; 1259 83487 > TABLE dbschema User > > pg_restore: [archiver (db)] could not execute query: ERROR: role > "User" does not exist > > Command was: ALTER TABLE public.dbschema OWNER TO "User" ». > > Please help me to solve this problem. > users are not stored as part of a single database, they are global to the database cluster. you need to create any users required by a given database before you can restore it. CREATE USER "User" WITH PASSWORD 'somekindapassword'; Note the same is true for tablespaces, if you use those. -- john r pierce 37N 122W somewhere on the middle of the left coast --------------020303010002060806040304 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 9/9/2013 11:38 PM, Sbis-Partner wrote:

When you restore a database error occurs

«Pg_restore: creating TABLE dbschema

pg_restore: [archiver (db)] Error from TOC entry 1428; 1259 83487 TABLE dbschema User

pg_restore: [archiver (db)] could not execute query: ERROR: role "User" does not exist

     Command was: ALTER TABLE public.dbschema OWNER TO "User" ».

Please help me to solve this problem.


users are not stored as part of a single database, they are global to the database cluster.      you need to create any users required by a given database before you can restore it.

CREATE USER "User" WITH PASSWORD 'somekindapassword';


Note the same is true for tablespaces, if you use those.

-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast
--------------020303010002060806040304--