Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iOOhq-0001Ws-NJ for pgsql-general@arkaria.postgresql.org; Sat, 26 Oct 2019 16:14:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iOOhp-0003a3-Es for pgsql-general@arkaria.postgresql.org; Sat, 26 Oct 2019 16:14:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iOOhn-0003ZL-DO for pgsql-general@lists.postgresql.org; Sat, 26 Oct 2019 16:14:21 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iOOhg-0008JZ-7A for pgsql-general@lists.postgresql.org; Sat, 26 Oct 2019 16:14:18 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 302AF220DD; Sat, 26 Oct 2019 12:14:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 26 Oct 2019 12:14:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=X cxPpq6DkA92N0RxfGaH/CPS+G8tU5VlK+JaMkk5cSw=; b=OjbEVicnmUoQV0KG2 bF/5vUtaNxMhGD9yvC72BiBTocz3soFJTEdqp/hbZe8HLllxlqlJKktG3DgvKr0U hl/tKbXC+q4AzrMJSx8agZwneeHEgY1glITOz8UgREUHB4c3qEpzMFHZlgEuE5Db EOEVQGIZrolBZ26ukK6P0cHyfMse9ejXrAeylWMSAP7MhT7Io3HUAZnurKCXxL00 8EJG8SN1YIufmQKgn2BJYXryQhJdSdIwPPED4gw4Nq1Hah/TJEDhxREnPTYXVjoR E/80/d8EqOaOgCv2rGk60icQajQhAiR+G5/W0CxClH0Nx89d7EGCCAg5LQVAVsbF y74zA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=XcxPpq6DkA92N0RxfGaH/CPS+G8tU5VlK+JaMkk5c Sw=; b=d/4StuVSBBLIa6gUffXBr0yOkq9siYuZPO6tmXiuDPiVSn6faBten/w9D 9Tvdql5IVFLn4uZdNOpSfuELXOHnE4yvI8lrNzHzojxzXcfW+JIx4L5DEp+mgOjI GuHe23TMSGXiZRqTtXP5fkKwwxPU5APe50J8BdovaVWop8Y+Prg2+96Qu9Vg4haR 5bZmzMQDigmaJGVKN4XWJ9kq2VR+YJVtJYoKP+L1DvsfNiHnBs7kEY4T5xxf4KtA +82/MN9dIeimmGfVORoAygOysiZ1cV03h9fU1caU6kw7i67ZhOOgsU41+ngBlxYB uijh7XTthAr2UnRrnxCkR3d+HGOoA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrleehgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejuddrvddu vddrudeffedrudekleenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklh grvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.133.189]) by mail.messagingengine.com (Postfix) with ESMTPA id 91AEBD6005E; Sat, 26 Oct 2019 12:14:09 -0400 (EDT) Subject: Re: Updating data: confirmation and question To: Rich Shepard , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <547c2d0b-70a5-2a62-6b9e-3ff852485dea@aklaver.com> Date: Sat, 26 Oct 2019 09:14:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: 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: Precedence: bulk On 10/26/19 8:38 AM, Rich Shepard wrote: > Before my old server died I ran pg_dumpall on the database there and copied > that to my new server. The old database was postgresql-10 and the new > one is > postgresql-11.5. > > Am I correct that I can run 'pgsql -f .sql' and overwrite the > existing databases with the newer data? That depends on how you ran pg_dumpall. For instance did you use -c?: https://www.postgresql.org/docs/11/app-pg-dumpall.html > > Checking the database names in both I see that I mistakenly used hyphens > rather than underscores in one database name. I can change that in the .sql > file but have not before learned how/whether I can change a database name > using psql. What's the best approach to changing the existing hypephenated > name? This?: https://www.postgresql.org/docs/11/sql-alterdatabase.html ALTER DATABASE name RENAME TO new_name > > TIA, > > Rich > > > > -- Adrian Klaver adrian.klaver@aklaver.com