[postgis-users] postgis introduction data bundle can not restore a backup.

Imre Samu pella.samu at gmail.com
Wed Apr 13 05:17:25 PDT 2022


> 5. Loading spatial data — Introduction to PostGIS
> ERROR:  type "public.geometry" does not exist

as I see in the  "4. Creating a Spatial Database"
https://postgis.net/workshops/postgis-intro/creating_db.html
there are 2 important step
- create Username as postgres.
- "CREATE EXTENSION postgis;"

and the restore should work.
if you see an error like "ERROR:  duplicate key value violates unique
constraint "nyc_census_blocks_pkey""
you have to use "-c"  option
"    -c, --clean                  clean (drop) database objects before
recreating"
add sometimes the "--verbose" option is also useful.


regards,
 Imre




Jian He <hejian.mark at gmail.com> ezt írta (időpont: 2022. ápr. 13., Sze,
11:32):

> 5. Loading spatial data — Introduction to PostGIS
> <http://postgis.net/workshops/postgis-intro/loading_data.html>
> Introduction to PostGIS — Introduction to PostGIS
> <http://postgis.net/workshops/postgis-intro/index.html> (data bundle)
>
> I use the follow command to restore a database.
>
> *pg_restore -h localhost -p 5432 -U jian -d postgis_in_action
> nyc_data.backup*
>
> I cannot load the backup file to database.
> Too many errors like :
>
>  ERROR:  type "public.geometry" does not exist
>  ERROR:  relation "public.nyc_census_blocks" does not exist
>
> There is only another .sql file. But the file only have one table:
> *nyc_census_sociodata*
>
> where can I get the table create script.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20220413/a9ccb617/attachment.html>


More information about the postgis-users mailing list