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 1oDqSb-0008VM-H5 for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 16:52:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDqSa-00069p-Bh for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 16:52:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDqSa-00066R-18 for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 16:52:36 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDqSX-0004yA-Mf for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 16:52:34 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 772FE320097C; Tue, 19 Jul 2022 12:52:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 19 Jul 2022 12:52:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1658249551; x= 1658335951; bh=txz7Ts1GfMV1rzlMkXy+hXoZFTiUJXyifybYkh/MDSI=; b=A lYXdI77fmEOg0xLmX8tdDHPqOTBrKH9AvOzz8s1tb19hY4AYEsdVmTCO+cTCdnGQ hcq7/cCFoTJu4OPpccqLGw6NCMgRQ3Z86Hc1ymkIzYrDyhhi9X162R4yX8W9Ge8E BASMaMhBBcKIRmDu/Im5YXGrTcXd0Grtl/2agOqpI9xMTBS8LHMnh67FJKc+kUBo DLqqM83BPEukDyKojcnQyq0/Z75Xeq/BntDoILxu2Sv0fX1DJ3QvGAFiI9xOTQWS auvY4ehB7ikJW5IWAMilEEYTenlahDMTznnEMIFXyuiXOEyVq3ojXjc/yhXbXg44 Li3y7/RktsTBP9Xli+7ZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1658249551; x=1658335951; bh=t xz7Ts1GfMV1rzlMkXy+hXoZFTiUJXyifybYkh/MDSI=; b=CsLMMriwpSTa6B6Zc /Vgsm//42zNMhFQhmtBBtsiBgQZPdBusBFmPKEvHv3M5afLA1c7J/XtdMZO3tOXe xZmtRS/vDv5b7hNhSaO6KhmUShB7QuSBWfiYZo9Q/FlDSTfqENaaD0tpkTnxG9bM ROHNQQe/Wcy19cqz35QpBaQm4O5+KgaZmvvEA5a3IZRlJWTNRFXkmcBEyyJTn3NR t92GG2xbIBVWIppK8UV2pUi9k4ude84Tz+4v7eF/K9XTX+ybpXdWknl6OSeNrUv1 RVGH+8GqsmxbcBfarsAnmoVzCPTeTM32VpMF3RAHQ4/wA8VgUAXvZ1U7Qw6vc0Hz kLyUQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeltddguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepveetjedtieekteefhffhhfetledvkeffvedugeej ueekhffgvdeileeitdekvefhnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughr ihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Jul 2022 12:52:31 -0400 (EDT) Subject: Re: restore question To: Ronald Haynes , pgsql-general@lists.postgresql.org, Ray O'Donnell References: <12b2292b-372c-4fe0-9f63-7f641bad688a@Spark> <72da6868-8a2c-4378-8857-8391763393cb@Spark> <89905c07-ae17-a1a7-2a26-ba8ab6109c50@rodonnell.ie> <592b6261-8a4f-481f-853a-b80f159dcb1e@Spark> From: Adrian Klaver Message-ID: Date: Tue, 19 Jul 2022 09:52:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <592b6261-8a4f-481f-853a-b80f159dcb1e@Spark> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/19/22 9:44 AM, Ronald Haynes wrote: > Thanks Ray, running > > pSql -f backup-file.sql > > > > psql: error: FATAL: database "rhaynes74" does not exist No that is expected as you did not specify a database to connect to using -d . In that case psql uses the OS user name you are running the command as for the database name per: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS dbname The database name. Defaults to be the same as the user name. In certain contexts, the value is checked for extended formats; see Section 34.1.1 for more details on those. So change the command to: psql -d postgres -U -f backup-file.sql Where is a database user that has the correct privileges to load/create the databases. > > Which seems odd since rhaynes74 is a user not a database name in the file. > > Sincerely, > > Dr. Ronald D. Haynes > Professor, Department of Mathematics and Statistics > Chair, MSc and Phd Scientific Computing Programs > Memorial University of Newfoundland -- Adrian Klaver adrian.klaver@aklaver.com