[postgis-users] Help resolving raster2pgsql error

558 views
Skip to first unread message

Ben Boughton

unread,
Jun 22, 2021, 4:32:21 PM6/22/21
to postgi...@lists.osgeo.org
I am having issues loading raster via raster2pgsql (RELEASE: 3.1.2 GDAL_VERSION=30 (cbe925d)); postgres (PostgreSQL) 13.3 (Ubuntu 13.3-1.pgdg20.04+1)

If I run:

raster2pgsql -C -R testr.tif testr > out.sql

Output:

Processing 1/1: testr.tif
ERROR 1: PROJ: proj_as_wkt: SQLite error on SELECT name, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, area_of_use_auth_name, area_of_use_code, publication_date, deprecated FROM geodetic_datum WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name
ERROR 1: PROJ: proj_as_wkt: SQLite error on SELECT name, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, area_of_use_auth_name, area_of_use_code, publication_date, deprecated FROM geodetic_datum WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name
ERROR 1: PROJ: proj_as_wkt: SQLite error on SELECT name, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, area_of_use_auth_name, area_of_use_code, publication_date, deprecated FROM geodetic_datum WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name
free(): invalid pointer
Aborted (core dumped)


Even just running:

raster2pgsql

gives the version and options followed by:

free(): invalid pointer
Aborted (core dumped)


The out.sql file is incomplete and doesn't load into database.

Any pointers appreciated. Thanks


Ben Boughton


Darafei "Komяpa" Praliaskouski

unread,
Jun 22, 2021, 5:41:06 PM6/22/21
to PostGIS Users Discussion
Your Proj installation seems broken. 

аў, 22 чэр 2021, 23:32 карыстальнік Ben Boughton <bbou...@gmail.com> напісаў:
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Mike Taves

unread,
Jun 22, 2021, 7:47:54 PM6/22/21
to PostGIS Users Discussion
On Wed, 23 Jun 2021 at 08:32, Ben Boughton <bbou...@gmail.com> wrote:
> Processing 1/1: testr.tif
> ERROR 1: PROJ: proj_as_wkt: SQLite error on SELECT name, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, area_of_use_auth_name, area_of_use_code, publication_date, deprecated FROM geodetic_datum WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name

You might have PROJ_LIB pointing to a different version of PROJ, as
the schema in proj.db has changed a few times between releases.

https://proj.org/usage/environmentvars.html#envvar-PROJ_LIB

Regina Obe

unread,
Jun 22, 2021, 9:19:24 PM6/22/21
to PostGIS Users Discussion, bbou...@gmail.com
[Regina Obe]

As Mike noted, proj.db has changed a number of times in proj releases.
Last person I ran into with this particular problem was because they got
their proj from main distro
And they had installed QGIS/GDAL via UbuntuGIS which installed a newer
version of proj. So they had two versions of proj, but the proj.db path was
the newer.

It was a mess to properly fix the install, so I ended up just giving him my
copy of proj.db to overwrite his.

Lesson: Don't mix distributions of GDAL/PROJ. Bad things happen.

You can check which version of Proj your postgis is running with

SELECT postgis_full_version();

And whatever proj that says you should be using a proj.db that was built
from that one.
I've got a bunch of versions of proj hanging around, so I could give you my
copy of proj.db for your version of Proj, if it comes to that.

Hope that helps,
Regina

Ben Boughton

unread,
Jun 23, 2021, 3:10:08 PM6/23/21
to Regina Obe, PostGIS Users Discussion
Thanks - sounds complicated.
I am running a fair bit of different stuff on the one remote server - including an install of QGIS and POSTGIS.
I might just spin up a tiny unique environment to get this job done, save messing up other things that rely on proj. 

Ben Boughton



Ben Boughton

unread,
Jun 23, 2021, 4:12:47 PM6/23/21
to PostGIS Users Discussion
I did a fresh install on Ubuntu 20.04 of postgresql-13-postgis-3
followed by apt install postgis to get raster2pgsql

I have the same problem.

It appears that postgresql-13-postgis-3 depends on libproj15 > 6 and postgis depends on libproj15 > 4.9 - would this be the problem?

If so, how do I go about rectifying this clash?

Ben Boughton




On Wed, 23 Jun 2021 at 11:19, Regina Obe <l...@pcorp.us> wrote:

Ben Boughton

unread,
Jun 23, 2021, 7:41:22 PM6/23/21
to Regina Obe, PostGIS Users Discussion
I tried a clean install - this time with the UbuntuGIS-Unstable and just did 'apt get install postgis' - I got postgis3 and postgresql12 and raster2pgsql working.

Ben Boughton




On Wed, 23 Jun 2021 at 11:19, Regina Obe <l...@pcorp.us> wrote:
Reply all
Reply to author
Forward
0 new messages