Re: PG_Restore error
David Haynes <[email protected]> Wed, 11 Feb 2026 10:02:26 -0600
| Newsgroups | gmane.comp.gis.postgis |
|---|---|
| Message-ID | <CAM4C04pb2eXNnac-sPcF_J4Xyb6=Ju7yLxc6U1X7T3hxRtkNpg@mail.gmail.com> |
--000000000000f5e56b064a8e7fca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the help. Can you provide me with the flags I should use on PG_Restore. On Tue, Feb 10, 2026 at 5:48=E2=80=AFAM Regina Obe <[email protected]> wrote: > Not sure what you mean by unintentionally dumped as binary format. That > is the preferred way. > > > > What you should do is the following: > > > > Create a blank database. > > > > Run > > > > CREATE EXTENSION postgis; > > CREATE EXTENSION postgis_raster; > > > > Then restore your database into the new one you created. > > > > 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. > > > > But your raster data will find the datatype and functions it needs in > postgis_raster so should do fine. > > > > *From:* David Haynes <[email protected]> > *Sent:* Tuesday, February 10, 2026 1:28 AM > *To:* [email protected] > *Subject:* PG_Restore error > > > > Hello, > > > > 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 extensio= n > 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. > > 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? > > > > Thanks for any feedback > --000000000000f5e56b064a8e7fca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Thanks for the help. Can you provide me with the flags I s= hould use on PG_Restore.=C2=A0</div><br><div class=3D"gmail_quote gmail_quo= te_container"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Feb 10, 2026 at= 5:48=E2=80=AFAM Regina Obe <<a href=3D"mailto:[email protected]">[email protected]<= /a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0= px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><= div class=3D"msg3132056190317257157"><div lang=3D"EN-US" style=3D"overflow-= wrap: break-word;"><div class=3D"m_3132056190317257157WordSection1"><p clas= s=3D"MsoNormal">Not sure what you mean by unintentionally dumped as binary = format.=C2=A0 That is the preferred way.<u></u><u></u></p><p class=3D"MsoNo= rmal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal">What you should do is = the following:<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u>= </p><p class=3D"MsoNormal">Create a blank database.<u></u><u></u></p><p cla= ss=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal">Run <u></u>= <u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNo= rmal">CREATE EXTENSION postgis;<u></u><u></u></p><p class=3D"MsoNormal">CRE= ATE EXTENSION postgis_raster;<u></u><u></u></p><p class=3D"MsoNormal"><u></= u>=C2=A0<u></u></p><p class=3D"MsoNormal">Then restore your database into t= he new one you created.<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2= =A0<u></u></p><p class=3D"MsoNormal">The only thing that should happen assu= ming you have an individual backup for your database, is that it will faili= ng when doing CREATE EXTENSION postgis;=C2=A0 which is fine and expected.<u= ></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"= MsoNormal">But your raster data will find the datatype and functions it nee= ds in postgis_raster so should do fine.<u></u><u></u></p><p class=3D"MsoNor= mal"><u></u>=C2=A0<u></u></p><div style=3D"border-top:none;border-right:non= e;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt">= <div><div style=3D"border-right:none;border-bottom:none;border-left:none;bo= rder-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class=3D"MsoNor= mal"><b><span style=3D"font-size:11pt;font-family:Calibri,sans-serif">From:= </span></b><span style=3D"font-size:11pt;font-family:Calibri,sans-serif"> D= avid Haynes <<a href=3D"mailto:[email protected]" target=3D"_blank">hay= [email protected]</a>> <br><b>Sent:</b> Tuesday, February 10, 2026 1:28 AM= <br><b>To:</b> <a href=3D"mailto:[email protected]" target=3D"_= blank">[email protected]</a><br><b>Subject:</b> PG_Restore erro= r<u></u><u></u></span></p></div></div><p class=3D"MsoNormal"><u></u>=C2=A0<= u></u></p><div><p class=3D"MsoNormal">Hello,<u></u><u></u></p><div><p class= =3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal">I = have an old PostgreSQL database dump file that uses the old PostGIS extensi= on. 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 Ext= ension postgis and=C2=A0 CREATE Extension postgis_raster; This particular d= atabase has both vector and raster datasets. To complicate matters, I unint= entionally dumped it in a binary format.=C2=A0<br><br>I have been somewhat = successful in getting the DB to load. I'm using a pg_restore command us= ing the following flags (--no-owner --create --clean). However, I get a lot= of errors because the database can not create raster datasets as that data= type does not exist. Is there a command that I can issue during this pg_res= tore process to initialize the postgis_raster extension? If not, what are m= y next steps? Do I need to load the database onto an older version of PostG= IS?<u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u>= </p></div><div><p class=3D"MsoNormal">Thanks for any feedback<u></u><u></u>= </p></div></div></div></div></div></div></blockquote></div> --000000000000f5e56b064a8e7fca--