It depends on what platform you are on.
Can you output the following from your postgis enabled databases:
SELECT postgis_full_version(), version();
And send us the output of what each says. That will give a clue of at least what platform you are running.
You’ll need to run this on each database you have with postgis installed on, as it is possible to have 2 versions of postgis installed in separate databases.
As to whether you’d need to drop and recreate any materialized views, it would depend on what functions they are using. If they are using deprecated or removed functions, then eventually you will need to drop and recreate, but you could do that at a later time. The PostGIS 3+ upgrade will notify you of those issues, but generally can just rename the functions in use, so you can drop and recreate at a more convenient time.
For materialized views that take a long time to build, I generally build them under a new name, and do a swap after the new one has been built. That would reduce the downtime from hours to 1-2 minutes.
Thanks,
Regina
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users
You’d probably want to upgrade PostgreSQL too since PostgreSQL 10 is EOL’d.
Below are some instructions I had written for Centos. Should be more or less the same for Redhat.
ALTER EXTENSION postgis UPDATE; it requests me to drop cascade around 200 materialized views. For the test DB, I did that, the update to postgis 3.3 went well but afterward, the vacuum step failed.I’ve never seen that error before.
It might be some OOM killer getting in the way as it’s failing on vacuuming of pg_catalog.pg_proc in template1, which is a really strange place to be failing since the template database have pretty much nothing, unless you installed some extension in them.
What does output – is it low?
free –h
It might be something in your postgresql.conf or postgresql.auto.conf like your maintenance_work_mem is set too high for your server.
Since you are doing non-link mode pg_upgrade, you should have 2 instances off pg now. I think if it got to the point of vacuumdb it’s already loaded all the data in the PG12 instance and you can check if everything is there.
Can you connect to your PostgreSQL 12, you might have to manually start it up
And then see if you can run below without it crashing. That is essentially what vacuumdb does:
psql -p 5433 -d template1 -c "vacuum (analyze,verbose);"
Also check what extensions you have installed in template1.
psql -p 5433 -d template1 -c "SELECT * FROM pg_extension;"
For template1, there is usually only one extension plpgsql.
If you have more, you might want to drop the others to rule out it’s some extension getting in the way.
Don’t see anything out of the ordinary.
You don’t have a postgresql.auto.conf file or is it empty? The custom settings might be in that one. The auto is set when you use
ALTER SYSTEM
and that would generally be copied over from your old instance.
Also are all your databases on PG12 and full as I would expect, since I think the failure happened after all the data was copied over already.
The fact vacuum(full, analyze) didn’t fail is good and perhaps suggests nothing to worry about.
Whatever killed vacuumdb sounds like another process that was running at the same time. The fact it happened even on the other server you are testing might be just something you consistently install. I would try the vacuum on each of your databases to see if any cause a crash.
I should add that ultimately it isn’t the vacuuming crashing, but something else running at the same time.
This article details how to find the root cause
https://pganalyze.com/docs/log-insights/server/S1
I have heard on occasion postgis raster crashing because of a bad library dependency (but this usually happens when on create extension of postgis (or postgis_raster) or running a raster process. I suppose it could happen on backend load of postgis libraries.
If you don’t need postgis raster, then the easy fix for that is just to
After you upgrade each database in your PG12 that has postgis installed with :
SELECT postgis_extensions_upgrade();
SELECT postgis_extensions_upgrade();
Do
DROP EXTENSION postgis_raster;
Dropping will fail if you have raster tables, so no need for concern accidentally dropping data.
From: Regina Obe [mailto:l...@pcorp.us]
Sent: Saturday, March 18, 2023 9:29 AM
To: 'PostGIS Users Discussion' <postgi...@lists.osgeo.org>
Subject: RE: [postgis-users] Help to upgrade postgresql10 with postgis 2.5
Don’t see anything out of the ordinary.
You don’t have a postgresql.auto.conf file or is it empty? The custom settings might be in that one. The auto is set when you use
ALTER SYSTEM
and that would generally be copied over from your old instance.
Also are all your databases on PG12 and full as I would expect, since I think the failure happened after all the data was copied over already.
The fact vacuum(full, analyze) didn’t fail is good and perhaps suggests nothing to worry about.
Whatever killed vacuumdb sounds like another process that was running at the same time. The fact it happened even on the other server you are testing might be just something you consistently install. I would try the vacuum on each of your databases to see if any cause a crash.
Well if you drop cascade postgis, you may be dropping table columns as well. So that is not a good idea.
You could try upgrading your PostgreSQL 10 to 3.something first and then upgrade that.