[postgis-users] restore problem
Paragon Corporation
lr at pcorp.us
Wed Nov 11 23:15:07 PST 2015
Darrel,
That all looks right but it seems the alter function part is being wiped out
If this statement is working:
ALTER FUNCTION _raster_constraint_nodata_values(raster)
SET search_path=pg_catalog,public,postgis;
Then that error shouldn't be happening.
This would happen if you are doing clean restore, as I think the restore would drop the postgis extension and then recreate thus losing the alter function settings you just put in.
Are you doing a clean restore – if you are uncheck that (if you are in pgAdmin)
If you are doing with via command-line, make sure to leave out the
-c or --clean
Switches.
I have to test this out. It's been a while since I restored the database I had this issue with. So I may have missed something else.
Thanks,
Regina
From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Darrel Maddy
Sent: Wednesday, November 11, 2015 2:03 PM
To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
Subject: Re: [postgis-users] restore problem
Dear Regina and Rich,
I tried to follow your instructions by doing the following:
1. I redid the backup of my database excluding the public schema. This completed with an exit code 0 so I am assuming no problems.
2. I created the ‘new’ database on my laptop and then added the postgis extension. All functions were there and the extension is in the Public schema.
3. I then ran the following script
ALTER FUNCTION _raster_constraint_pixel_types(raster)
SET search_path=pg_catalog,public,postgis;
ALTER FUNCTION _raster_constraint_info_regular_blocking(name,name,name)
SET search_path=pg_catalog,public,postgis;
ALTER FUNCTION _raster_constraint_nodata_values(raster)
SET search_path=pg_catalog,public,postgis;
ALTER FUNCTION _raster_constraint_out_db(raster)
SET search_path=pg_catalog,public,postgis;
4. I then attempted the restore and unfortunately the same thing happened again .i.e
pg_restore: processing data for table "dems"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3418; 0 94054 TABLE DATA dems postgres
pg_restore: [archiver (db)] COPY failed for table "dems": ERROR: function st_bandmetadata(public.raster, integer[]) does not exist
LINE 1: ...(round(nodatavalue::numeric, 10))::numeric[] FROM st_bandmet...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
QUERY: SELECT array_agg(round(nodatavalue::numeric, 10))::numeric[] FROM st_bandmetadata($1, ARRAY[]::int[]);
CONTEXT: SQL function "_raster_constraint_nodata_values" during inlining
COPY dems, line 1: "1 0100000100000000000000344000000000000034C0E0CCCCCCB1D517418066666692F80C41000000000000000000000000..."
pg_restore: executing SEQUENCE SET dems_rid_seq
Firstly, is this what you expected me to do or did I misunderstand? Secondly, does this mean that I have to do this for each of the _raster_constraint functions? (I think there are 16 of them)
Hopefully I am making progress.
Darrel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20151112/1015c2ab/attachment.html>
More information about the postgis-users
mailing list