[pycsw-devel] Preparing Postgres/Postgis DB

Angelos Tzotsos gcpp.kalxas at gmail.com
Thu May 23 15:59:01 PDT 2013


Hi Jeff,

PostGIS 2.x native support is in git master (to be released as 1.6.0).

Cheers,
Angelos

On 05/23/2013 11:21 PM, Jeff McKenna wrote:
> Hello all,
>
> (I apologize if this is a simple question/answer)
>
> I have created a new PostgreSQL database (named "pycsw-demo"), and
> loaded the PostGIS extension (I'm using PostGIS 2.0.2).  So, this db has
> a single existing table, named "spatial_ref_sys".
>
> However when I try to setup_db it I get the following error, like it is
> not happy that this spatial table already exists:
>
> ****
>     python ./sbin/pycsw-admin.py -c setup_db -f default.cfg
>
> 	Initializing static context
> 	Creating database postgresql://postgres:xxxx@yyyyy:5435/pycsw-demo
> 	Creating table spatial_ref_sys
> 	Traceback (most recent call last):
> 	  File "./sbin/pycsw-admin.py", line 239, in <module>
> 	    admin.setup_db(DATABASE, TABLE, HOME)
> 	  File
> "C:\Python26\Scripts\pycsw-workshop\lib\site-packages\pycsw\admin.py",
> line 62, in
> 	setup_db
> 	    srs.create()
> 	  File "build\bdist.win32\egg\sqlalchemy\schema.py", line 614, in create
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 1479, in
> _run_visitor
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 1122, in
> _run_visitor
> 	  File "build\bdist.win32\egg\sqlalchemy\sql\visitors.py", line 111, in
> traverse_single
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\ddl.py", line 89, in
> visit_table
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 662, in
> execute
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 720, in
> _execute_ddl
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 874, in
> _execute_context
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 1024, in
> _handle_dbapi_exce
> 	ption
> 	  File "build\bdist.win32\egg\sqlalchemy\util\compat.py", line 163, in
> raise_from_cause
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 867, in
> _execute_context
> 	  File "build\bdist.win32\egg\sqlalchemy\engine\default.py", line 324,
> in do_execute
> 	sqlalchemy.exc.ProgrammingError: (ProgrammingError) relation
> "spatial_ref_sys" already exi
> 	sts
> 	 '\nCREATE TABLE spatial_ref_sys (\n\tsrid SERIAL NOT NULL,
> \n\tauth_name VARCHAR(256), \n
> 	\tauth_srid INTEGER, \n\tsrtext VARCHAR(2048), \n\tPRIMARY KEY
> (srid)\n)\n\n' {}
> ****
>
> Is there something like an append setting for setup_db ?
>
> -jeff
>
>


-- 
Angelos Tzotsos
Remote Sensing Laboratory
National Technical University of Athens
http://users.ntua.gr/tzotsos



More information about the pycsw-devel mailing list