I'm trying to transition from an old Postgres/Postgis database to a new one. I'm working in a fresh install of Win 7 64 bit. I installed Postgresql 9.3 32 bit, then installed PostGIS 2.1.3. I created a new blank database called medford, and ran
create extension postgis
create extension postgis_topology
without error. I also installed the legacy like this:
psql -d medford -f legacy.sql
Then, on my old system, running Postgres 9.2 and PostGIS 2.0.3, I ran this backup:
pg_dump -h localhost -p 5432 -U postgres -Fc -b -v -f "c:\backup\pgdumpmedford.backup" medford
and then restored it into the new blank database using a batch file like this:
set PGPORT=5433
set PGHOST=localhost
set PGUSER=postgres
set PGPASSWORD=nottherealpasswrd
set THEDB=medford
set BACKUPFILE=c:\Data\medford.backup
set PGINSTALL=C:\Program Files (x86)\PostgreSQL\9.3
set PATH=%PATH%;"%PGINSTALL%\bin"
perl "%PGINSTALL%\utils\postgis_restore.pl" "%BACKUPFILE%" | psql %THEDB% 2> errors.txt
When I run the command
Select Postgis_full_version();
I get this which looks fine: POSTGIS="2.1.3 r12547" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, releaed 2013/04/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER (1 row). However, when I open QGIS 2.2 and try to add a postgis layer from the new postgres 9.3 database, I can connect and add a layer of type "multipolygon", and the layer name appears in the table of contents layers list, but nothing shows up in the map view. I've read over this post, and that doesn't seem to help. I've checked my Postgres log and I see this there, but I don't know what it means:
2014-05-29 13:39:59 EDT ERROR: relation "layer_styles" does not exist at character 22
2014-05-29 13:39:59 EDT STATEMENT: SELECT styleQML FROM layer_styles WHERE f_table_catalog='medford' AND f_table_schema='medford' AND f_table_name='OpequonSubShed2' AND f_geometry_column='the_geom' ORDER BY CASE WHEN useAsDefault THEN 1 ELSE 2 END,update_time DESC LIMIT 1
If there's supposed to be some kind of layer_styles table in my database, I don't see it when using pgAdmin. I also don't see a layer_styles table in my old database. On my previous installation, I had no problems seeing the postgis layers in QGIS. Can someone give me an idea of why I can't see the Postgis layers in my new postgres/postgis and QGIS installation?