Opened 9 years ago

Closed 9 years ago

#3381 closed defect (worksforme)

Can't load postgis - 'unknown error 193'

Reported by: kylotan Owned by: robe
Priority: medium Milestone: PostGIS 2.2.1
Component: build Version: 2.2.x
Keywords: windows Cc:


I get this dialog in PGAdmin (and the text at the end if I just try the SQL statement 'create extension postgis')

pgAdmin III

An error has occurred:

ERROR: could not load library "C:/Program Files/PostgreSQL/9.4/lib/postgis-2.2.dll": unknown error 193

I've confirmed that I'm running 64 bit versions of everything, and that there's no other instance of postgis-2.2.dll on my hard disk.

OS: Win 8.1. 64bit

Postgres: PostgreSQL 9.4.5, compiled by Visual C++ build 1800, 64-bit

postgis: 2.2.0 64bit, downloaded from or installed via StackBuilder from EnterpriseDB, makes no difference

Attachments (1)

app_stackbuilder.png (6.6 KB ) - added by robe 9 years ago.
stackbuilder for 64-bit

Download all attachments as: .zip

Change History (6)

comment:1 by kylotan, 9 years ago

Component: postgisbuild/upgrade/install
Keywords: windows added
Owner: changed from pramsey to strk

comment:2 by robe, 9 years ago

Just to confirm - you were using this one right?

When you install via Stackbuilder — it shows two, if you chose the 32-bit one time then it shows that error. If one time you installed 32-bit via stackbuilder by accident, it might show 32-bit also installed even if you just installed in the 64-bit folder

stackbuilder for 64-bit

I just checked one of the installs I did via stackbuilder and it shows this but that's a windows 2012 R2 (which should be pretty similar to windows 8 and 8.1)

POSTGIS="2.2.0 r14208" GEOS="3.5.0-CAPI-1.9.0 r4090" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.0.1, released 2015/09/15" LIBXML="2.7.8" LIBJSON="0.12" RASTER

So I think the binaries are okay.

Now if you did make a mistake once and copied the 32-bit libraries or installed the 32-bit install and reinstall the 64-bit postgis. Your install might still be broken.

This is because the libxml2-2.dll doesn't get overwritten (that's because sometimes EDB distributes that and sometimes they don't so the installer installs one if it doesn't see one present, and if you just copied from the zip, you would get that one).

So if that is the issue, what you could do is delete the libxml2-2.dll and copy the one called libxml2.dll (and give the new copy name libxml2-2.dll )

Version 2, edited 9 years ago by robe (previous) (next) (diff)

by robe, 9 years ago

Attachment: app_stackbuilder.png added

stackbuilder for 64-bit

comment:3 by robe, 9 years ago

Owner: changed from strk to robe

comment:4 by kylotan, 9 years ago

There had been some previous upgrading of components going on which may have included the 32 bit version so this is almost certainly what happened to me. I performed the delete/rename trick with libxml and now it appears to work, thanks.

comment:5 by robe, 9 years ago

Resolution: worksforme
Status: newclosed

Great so not an issue with the installer. What a relief. Though I still would like to prevent such a thing from happening at least not to show both the 32-bit and 64-bit if you picked the PostgreSQL 64-bit port install. I asked EDB folks about this a while back they said technically since a 32-bit software can be installed on a 64-bit OS, the way the application builder works, it has to show both as options. So people who are only on 32-bit only ever see the 32-bit option (but sadly 64-bit people see both regardless which version of PostgreSQL they picked). :)

For future I may minimize this by just always overwriting the libxml2-2.dll for 64-bit install. As I recall, I think it might only be for the 32-bit where they sometimes package libxml2-2.dll and sometimes they don't. The main reason I don't overwrite is if they do have a liblxml2-2.dll, means they are linking with that name and their libxml version has more stuff compiled in than what I bother with including with PostGIS, so PostGIS will work with their version, but their version may not work with what I ship.

Note: See TracTickets for help on using tickets.