Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDvIf-0046Ug-S5 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2024 00:44:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tDvHg-00AZ1T-H8 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2024 00:43:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDvHg-00AZ1K-6K for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2024 00:43:00 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDvHc-002xrR-FR for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2024 00:42:58 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 2B75447975; Thu, 21 Nov 2024 01:42:53 +0100 (CET) Date: Thu, 21 Nov 2024 01:42:53 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Help with restoring database from old version of PostgreSQL Message-ID: <20241121004253.c2lnudww5nlmxmb2@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <1fe9de96-6ebe-4e3a-9b15-ae8a11986664@aklaver.com> <11b5cfbd-cb44-4bc5-b74e-c6c682d9cfb9@aklaver.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ohm3lwmdxd24ds5o" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ohm3lwmdxd24ds5o Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-11-19 16:47:40 -0500, Catherine Frock wrote: > I am trying to restore a previously backed up database .sql file that was > created in PostgreSQL 9.6 using pgAdmin4 (I'm not sure which version I was > using). >=20 > In response to Ron: Do I need to use PG16 instead of pgAdmin4? As Ron already pointed out, these are different things. PostgreSQL is a Database. PgAdmin ist a Client for that database. You can't use one instead of the other. You can only use them together (but of course you could use a different client instead of PgAdmin4). > I set the=A0PostgreSQL Binary Path to:=A0C:\Program > Files\PostgreSQL\17\bin. I have tried to restore my database using > this in the command prompt: "psql.exe db_2024_9 < > C:\postgis\db_2017-08-16.sql postgres" using an empty database in both > the PostgreSQL 9.6 and 17 servers, and this is the result: >=20 > Password for user postgres: > SET [...] > ALTER TABLE > ERROR: =A0role "basic_user" does not exist [...] > ALTER DEFAULT PRIVILEGES > ERROR: =A0role "basic_user" does not exist That looks fine except that the user "basic_user" doesn't exist. You should create that before restoring the backup. Or could fix the errors after the fact but for that you need to understand what went wrong. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --ohm3lwmdxd24ds5o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmc+ggYACgkQ8g5IURL+ KF3Qog/+JNndxkKLghcMCw255IFsqDml5i5YT17TtgsRgX9aKR7tu7l881BseeRy tnxZJwgOhP3HozXRuA7zlPpGGH48mgMW373i+5sDSPgFiu+/+CHJvonY9no4TlzL QSzcasztDZngL4l2ySdkp2fcW06jEXyMH/3IxXUQyhcjJsY6OJP0RtE2AUcsQgIf FSfhFh57XdJ++1xZJihjBpQqN9TqrAa6r2e0nK+lXACLXQ5+qUa4rGwhhiW/K3aD cgV3o7y8ElBPkCYCgVc73OppD0SIQTSSWP3hL3W+JF+oP+GSG/CmbxlLewTPwvQ8 0fFbW4/5imJ6bTT4YOUByMEGm7fcqTMTzoBl04BC5G8y34vgyZMi6IGCdshT2nh8 oaRHUo1USHqFp7CpBKvD58InvrETNVM/hW1MfO322QjvnNsTga+bSllk05sGEDQG 4unBcFWCenjcaHLjyMOWfOnGUg52P9gH5FNzSvmMHc3fe/hkbeaUFQ7T9i4OAFO0 ERh1Mk1cx2JkL4urc+B192peF7JttpwXhbWzkx17+W0jpXeNLy2E0VMAMhkbyCJB 3wAlgJXT2HD62dTchz26gIISlurx25TwWIal9+G/jcKbzP0I6D6EI6TVtH7y3Q6z A7z/eQADSZ0gZdmm6qHtn7YiFNDYUs1OZty6Iqxi81Y7Gi9WJSo= =gN3U -----END PGP SIGNATURE----- --ohm3lwmdxd24ds5o--