[postgis-tickets] [PostGIS] #2644: pgsql2shp error on streaming replica: cannot execute CREATE TABLE AS in a read-only transaction

PostGIS trac at osgeo.org
Wed Feb 12 09:57:06 PST 2014


#2644: pgsql2shp error on streaming replica: cannot execute CREATE TABLE AS in a
read-only transaction
---------------------------+------------------------------------------------
 Reporter:  dfuhry         |       Owner:  mcayland     
     Type:  defect         |      Status:  new          
 Priority:  medium         |   Milestone:  PostGIS 2.1.2
Component:  loader/dumper  |     Version:  2.1.x        
 Keywords:                 |  
---------------------------+------------------------------------------------
 pgsql2shp when run against a PostgreSQL streaming replica gives output:
 {{{
 Initializing...
 Error executing user query: ERROR:  cannot execute CREATE TABLE AS in a
 read-only transaction
 }}}

 because streaming replicas are read-only and cannot execute mutable
 queries like CREATE TEMP TABLE in the ShpDumperOpenTable function in
 pgsql2shp-core.c.

 A fix would be to instead of creating a temp table, PQexec the query, read
 data types from the PGresult, and compute field widths by scanning the
 result, something like how psql does in the printQuery and
 print_aligned_text methods in Postgres' psql/print.c.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2644>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list