From sbis-partner@mail.ru Tue Sep 10 16:05:48 2013 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJQRo-00033b-Gx for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Sep 2013 16:05:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VJQRn-00064T-Vf for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Sep 2013 16:05:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJHaV-00068k-2q for pgsql-bugs@postgresql.org; Tue, 10 Sep 2013 06:38:11 +0000 Received: from smtp40.i.mail.ru ([94.100.177.100]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJHaS-00070e-Nh for pgsql-bugs@postgresql.org; Tue, 10 Sep 2013 06:38:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=LDnbOrR+7z0if/1gLGTWdrOuDbRRZ2OTo++uV5UdJr4=; b=cFMMKTTFPtxQdG7mxUL0q9Ciw39B+bSbm17rs/3pnkaQ/1G6MLeetmtYRvl/DcPP/jNC8JFV0rkPCrwbYpS/uDiTJ4kMNMKm2MxivpRnrBEKyswPg2xmclbZnTqxHXtbB4P7RF8YWuFAIeCqIsZpqlS+vu+8JZ3k8Zr9K+fQ/zE=; Received: from [37.78.218.5] (port=43889 helo=engineer) by smtp40.i.mail.ru with esmtps (envelope-from ) id 1VJHaP-0002ns-G7 for pgsql-bugs@postgresql.org; Tue, 10 Sep 2013 10:38:07 +0400 From: "Sbis-Partner" To: Subject: Error by restore a database Date: Tue, 10 Sep 2013 10:38:16 +0400 Message-ID: <42EBFBAC02A8479EBBC7D47042E08163@engineer> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0058_01CEAE11.DEB935C0" X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac6t8FTElu+xuOQETLqOAMsaeVg2ZQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Spam: Not detected X-Mras: Ok X-Pg-Spam-Score: 0.7 (/) 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. ------=_NextPart_000_0058_01CEAE11.DEB935C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello! When you restore a database error occurs . Please help me to solve this problem. ------=_NextPart_000_0058_01CEAE11.DEB935C0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello!

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.

------=_NextPart_000_0058_01CEAE11.DEB935C0-- From pierce@hogranch.com Tue Sep 10 17:03:38 2013 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-- From michael.paquier@gmail.com Wed Sep 11 13:08:39 2013 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJk9v-0001rf-CH for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Sep 2013 13:08:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VJk9u-0000DX-Sn for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Sep 2013 13:08:38 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJk9u-0000DR-6W for pgsql-bugs@postgresql.org; Wed, 11 Sep 2013 13:08:38 +0000 Received: from mail-wg0-x235.google.com ([2a00:1450:400c:c00::235]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJk9r-0003kb-Bu for pgsql-bugs@postgresql.org; Wed, 11 Sep 2013 13:08:37 +0000 Received: by mail-wg0-f53.google.com with SMTP id x12so5563495wgg.20 for ; Wed, 11 Sep 2013 06:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=mTKtHCFSu9gT3FMeLPnm7ulR2bTE4//qSuBHl7glIik=; b=N6RM0lVGFX3dZ4zulqAUbL1oF2Azz7jzYu5uXGd+UP7o16RU0vv7QNaO2LxDFdZL8k nKPDFR2BtZsniePRsr9Hn7u/0V3rB1NVVQJhtwQuMYYKwUrtHyN0MdhTzTgzhYECEtia BctxD8afGq3HvhdOJULEXg43KA2ho4MDnnulyAs7K6FjtQCW4BbaQrfxlLPzxtXGnAp9 RwjIozn/ftkJF+cOR80BVwtAu3hS/REuMHRQ4QXrp9/ihMTxa7UhcaM7uMmMhBWxuu6Q AZJ+JWVx3lX21NxS0S0k+Dws9NjiMnEyD6jAxUgpC0y4ySFUq6B6WlXpez/ls4M5HyHn fuWw== MIME-Version: 1.0 X-Received: by 10.180.206.42 with SMTP id ll10mr17369598wic.50.1378904914118; Wed, 11 Sep 2013 06:08:34 -0700 (PDT) Received: by 10.180.10.195 with HTTP; Wed, 11 Sep 2013 06:08:34 -0700 (PDT) In-Reply-To: <42EBFBAC02A8479EBBC7D47042E08163@engineer> References: <42EBFBAC02A8479EBBC7D47042E08163@engineer> Date: Wed, 11 Sep 2013 06:08:34 -0700 Message-ID: Subject: Re: Error by restore a database From: Michael Paquier To: Sbis-Partner Cc: pgsql-bugs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -0.1 (/) 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 On Mon, Sep 9, 2013 at 11:38 PM, Sbis-Partner wrote: > Hello! > > When you restore a database error occurs > > =ABPg_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" d= oes > not exist > > Command was: ALTER TABLE public.dbschema OWNER TO "User" =BB. User and group information are missing in your dump, this information can be retrieved with pg_dumpall. There are two possibilities in your case: - Use the dump you created previously and complete it with data from pg_dumpall --globals-only containing only user and tablespace information - Use a global dump with pg_dumpall with the user information as well as the database The latter solution is more instinctive IMO, but the former solution will work fine as well. --=20 Michael --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs