<div dir="ltr"><div><br></div><div>Thanks.  Problem solved. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 13, 2022 at 5:51 PM Imre Samu <<a href="mailto:pella.samu@gmail.com">pella.samu@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">> 5. Loading spatial data — Introduction to PostGIS<br><div>> ERROR:  type "public.geometry" does not exist</div><div><br></div><div>as I see in the  "4. Creating a Spatial Database"  <a href="https://postgis.net/workshops/postgis-intro/creating_db.html" target="_blank">https://postgis.net/workshops/postgis-intro/creating_db.html</a> </div><div>there are 2 important step</div><div>- create Username as postgres.   </div><div>- "CREATE EXTENSION postgis;"</div><div><br></div><div>and the restore should work.</div><div>if you see an error like "ERROR:  duplicate key value violates unique constraint "nyc_census_blocks_pkey""</div><div>you have to use "-c"  option</div><div><font face="monospace">"    -c, --clean                  clean (drop) database objects before recreating"</font><br></div><div>add sometimes the "--verbose" option is also useful. </div><div><br></div><div><br></div><div>regards,</div><div> Imre</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Jian He <<a href="mailto:hejian.mark@gmail.com" target="_blank">hejian.mark@gmail.com</a>> ezt írta (időpont: 2022. ápr. 13., Sze, 11:32):<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"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><a href="http://postgis.net/workshops/postgis-intro/loading_data.html" target="_blank">5. Loading spatial data — Introduction to PostGIS</a><br></div><div dir="ltr"><a href="http://postgis.net/workshops/postgis-intro/index.html" target="_blank">Introduction to PostGIS — Introduction to PostGIS</a> (data bundle)<br></div><div dir="ltr"><br></div><div>I use the follow command to restore a database.</div><div><br></div><div dir="ltr"><b>pg_restore -h localhost -p 5432 -U jian -d postgis_in_action nyc_data.backup</b></div><div dir="ltr"><br></div><div>I cannot load the backup file to database.</div><div>Too many errors like :</div><div><br></div><div> ERROR:  type "public.geometry" does not exist</div><div> ERROR:  relation "public.nyc_census_blocks" does not exist<br></div><div><br>There is only another .sql file. But the file only have one table:<font color="#000000"> <span style="font-family:"JetBrains Mono",monospace;font-size:9.8pt;background-color:rgb(255,255,255)"><b>nyc_census_sociodata</b></span></font><br></div><div><font color="#000000"><span style="font-family:"JetBrains Mono",monospace;font-size:9.8pt;background-color:rgb(255,255,255)"><b><br></b></span></font></div><div><font color="#000000"><span style="font-family:"JetBrains Mono",monospace;font-size:9.8pt;background-color:rgb(255,255,255)">where can I get the table create script. </span></font></div><div><br></div></div></div></div></div></div></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>