561553 (4) [Avatar] Offline
#1
when I try to load Victoria city boundary linestrings I get the following error :

ERROR: no existe la relación «ch13_staging.cityboundary»
LINE 7: SELECT gid, (ST_Dump(geom)).geom FROM ch13_staging.citybound...

I tried loading ch13_staging schema from SQL Shell (using psql -f ch13_staging.sql) and directly from pgadmin 4 but it seems not work

please help

regards
regina.leo (265) [Avatar] Offline
#2
What error do you get when you try to load ch13_staging.sql? I see the table creation in that file so that should have worked.

You would need to use psql to load the file since it has psql specific commands that can't be loaded via pgAdmin4

561553 (4) [Avatar] Offline
#3
Hi Regina/Leo,

what happens is that when I run the code of listing 13.10:

SELECT
          gid,
          TopoGeo_AddLineString(
                   'ch13_topology', ST_Transform(geom, 32610)
           ) As edge_id
FROM (
           SELECT gid, (ST_Dump(geom)).geom FROM ch13_staging.cityboundary
) As f;



i get the error "ERROR: no existe la relación «ch13_staging.cityboundary»" what in english is "ERROR:there is no relationship «ch13_staging.cityboundary»". For this reason I thought it was due to a failure to load the ch13_staging schema, but from what you tell me it seems that is not that.


anyway, when using SQL Shell I do not have any particular error message, I do it in the following way:

Username [postgres]:
Contraseña para usuario postgres:
psql (10.3)
ADVERTENCIA: .....
            Vea la página de referencia de psql «Notes for Windows users»
            para obtener más de....
Digite «help» para obtener ayuda.

postgres=# psql -f ch13_staging.sql
postgres-#



im a little bit confused.

regards.






regina.leo (265) [Avatar] Offline
#4
Looks like you are loading the data in the postgres database. You don't want to do that. I suspect maybe you are querying a different database.

So what you want to do is in psql

do something like:

\connect postgis_in_action


and then run the

\i ch13_staging.sql



The psql -f doesn't need to be run in psql env which it looks like you are in. If you want to do it that way, then you'd from command prompt

psql -f ch13_staging.sql -d postgis_in_action



replacing the postgis_in_action with the name of the database you want to load the data into.

561553 (4) [Avatar] Offline
#5
Thank you very much!