<div dir="ltr">You probably don't need any flags beyond specifying the target database name. Follow Regina instructions: create a target database and add postgis and postgis_raster extensions to it. The run pg_restore like:<div>     pg_restore   -d  target_database_name   your_pg_dump_file.backup</div><div>Postgres error messages are usually pretty clear so if that doesn't work it will probably tell you why.</div><div><br></div><div>Rich</div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Feb 11, 2026 at 9:41 AM David Haynes <<a href="mailto:haynesd2@gmail.com">haynesd2@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks for the help. Can you provide me with the flags I should use on PG_Restore. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 10, 2026 at 5:48 AM Regina Obe <<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div lang="EN-US"><div><p class="MsoNormal">Not sure what you mean by unintentionally dumped as binary format.  That is the preferred way.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">What you should do is the following:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Create a blank database.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Run <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">CREATE EXTENSION postgis;<u></u><u></u></p><p class="MsoNormal">CREATE EXTENSION postgis_raster;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Then restore your database into the new one you created.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">But your raster data will find the datatype and functions it needs in postgis_raster so should do fine.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt"><div><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> David Haynes <<a href="mailto:haynesd2@gmail.com" target="_blank">haynesd2@gmail.com</a>> <br><b>Sent:</b> Tuesday, February 10, 2026 1:28 AM<br><b>To:</b> <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br><b>Subject:</b> PG_Restore error<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hello,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">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?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks for any feedback<u></u><u></u></p></div></div></div></div></div></div></blockquote></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Richard W. Greenwood<br></div></div>