You only need to modify the raster functions used in constraints (not all).
Sadly the plan I had which people were most agreeable to involved using @@EXTENSION@@ to dictate the path. That did not work and even if it did would have the bad side effect that moving your extension to another schema would break those functions.
The plan I had which many felt was dirty was for the functions in question explicitly set the search_path to common ones people use
So would be set to something like search_path = postgis,public, contrib
This would work for most people because postgres ignores schemas in search paths if they don't exist so fact you don't have postgis doesn't matter for example, but a lot of folks seem to be switching to installing postgis in a schema called postgis.
I think what I will end up having to do since this is a serious problem is just post a tip in our tips section - http://postgis.net/tips/ detailing the issue and workaround.
With a sample script that does this dirty search_path thing for key functions where it's an issue (functions where it's an issue is not just limited to raster by the way e.g. ST_Transform I as a habit always do this to). As ugly as people think it is, I've found it’s the least painful way of working around this issue for insuring all your data and indexes are restored.
From: postgis-devel [mailto:[hidden email]] On Behalf Of David Haynes II Sent: Wednesday, January 27, 2016 2:40 PM To: PostGIS Development Discussion <[hidden email]> Subject: [postgis-devel] pg_dump / pg_restore
I just wanted to ask a quick question about the progress on the work around for dumping and restoring raster tables in postgis. I found this thread here (https://trac.osgeo.org/postgis/ticket/2485#no1) indicating that a work around was proposed and then the ticket was closed. But I seem to be encountering the same issue in PostGIS 2.1.7.
Is there an estimated release version for this problem?
If I am impatient and want to fix this myself, according to Regina's work around, will I need to modify every PostGIS function that has a raster dataset or only those that are associated with the raster constraints.