RE: PG_Restore error
"Regina Obe" <[email protected]> Tue, 10 Feb 2026 06:48:37 -0500
| Newsgroups | gmane.comp.gis.postgis |
|---|---|
| Message-ID | <[email protected]> |
This is a multipart message in MIME format. ------=_NextPart_000_000E_01DC9A59.4991C8D0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Not sure what you mean by unintentionally dumped as binary format. That = is the preferred way. =20 What you should do is the following: =20 Create a blank database. =20 Run=20 =20 CREATE EXTENSION postgis; CREATE EXTENSION postgis_raster; =20 Then restore your database into the new one you created. =20 The only thing that should happen assuming you have an individual backup = for your database, is that it will failing when doing CREATE EXTENSION = postgis; which is fine and expected. =20 But your raster data will find the datatype and functions it needs in = postgis_raster so should do fine. =20 From: David Haynes <[email protected]>=20 Sent: Tuesday, February 10, 2026 1:28 AM To: [email protected] Subject: PG_Restore error =20 Hello, =20 I have an old PostgreSQL database dump file that uses the old PostGIS = extension. What I mean is that the database was created when the = extension used to be CREATE Extension PostGIS. Now there are at least 2 = commands: CREATE Extension postgis and CREATE Extension postgis_raster; = This particular database has both vector and raster datasets. To = complicate matters, I unintentionally dumped it in a binary format.=20 I have been somewhat successful in getting the DB to load. I'm using a = pg_restore command using the following flags (--no-owner --create = --clean). However, I get a lot of errors because the database can not = create raster datasets as that datatype does not exist. Is there a = command that I can issue during this pg_restore process to initialize = the postgis_raster extension? If not, what are my next steps? Do I need = to load the database onto an older version of PostGIS? =20 Thanks for any feedback ------=_NextPart_000_000E_01DC9A59.4991C8D0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta = http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta = name=3DGenerator content=3D"Microsoft Word 15 (filtered = medium)"><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:Aptos;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; font-size:12.0pt; font-family:"Aptos",sans-serif;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:"Aptos",sans-serif; color:windowtext;} .MsoChpDefault {mso-style-type:export-only;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DEN-US = link=3D"#467886" vlink=3D"#96607D" style=3D'word-wrap:break-word'><div = class=3DWordSection1><p class=3DMsoNormal>Not sure what you mean by = unintentionally dumped as binary format.=C2=A0 That is the preferred = way.<o:p></o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p = class=3DMsoNormal>What you should do is the following:<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Create a = blank database.<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Run = <o:p></o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p = class=3DMsoNormal>CREATE EXTENSION postgis;<o:p></o:p></p><p = class=3DMsoNormal>CREATE EXTENSION postgis_raster;<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Then restore = your database into the new one you created.<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>The only = thing that should happen assuming you have an individual backup for your = database, is that it will failing when doing CREATE EXTENSION = postgis;=C2=A0 which is fine and expected.<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>But your = raster data will find the datatype and functions it needs in = postgis_raster so should do fine.<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><div = style=3D'border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in = 4.0pt'><div><div style=3D'border:none;border-top:solid #E1E1E1 = 1.0pt;padding:3.0pt 0in 0in 0in'><p class=3DMsoNormal><b><span = style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span><= /b><span style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'> = David Haynes <[email protected]> <br><b>Sent:</b> Tuesday, = February 10, 2026 1:28 AM<br><b>To:</b> = [email protected]<br><b>Subject:</b> PG_Restore = error<o:p></o:p></span></p></div></div><p = class=3DMsoNormal><o:p> </o:p></p><div><p = class=3DMsoNormal>Hello,<o:p></o:p></p><div><p = class=3DMsoNormal><o:p> </o:p></p></div><div><p class=3DMsoNormal>I = have an old PostgreSQL database dump file that uses the old PostGIS = extension. What I mean is that the database was created when the = extension used to be CREATE Extension PostGIS. Now there are at least 2 = commands: CREATE Extension postgis and CREATE Extension = postgis_raster; This particular database has both vector and raster = datasets. To complicate matters, I unintentionally dumped it in a binary = format. <br><br>I have been somewhat successful in getting the DB = to load. I'm using a pg_restore command using the following flags = (--no-owner --create --clean). However, I get a lot of errors because = the database can not create raster datasets as that datatype does not = exist. Is there a command that I can issue during this pg_restore = process to initialize the postgis_raster extension? If not, what are my = next steps? Do I need to load the database onto an older version of = PostGIS?<o:p></o:p></p></div><div><p = class=3DMsoNormal><o:p> </o:p></p></div><div><p = class=3DMsoNormal>Thanks for any = feedback<o:p></o:p></p></div></div></div></div></body></html> ------=_NextPart_000_000E_01DC9A59.4991C8D0--