I recently ran into a weird error for which I cannot find a solution
(tried Google and such) adn I could really use your help.
I installed posgresql 9.1 and postgis 1.5.3 on a Windiws Server 2008
R2 (64bit) machine and for some time everything went fine. Then two
days ago I was not able to view any data table that used the geography
data type anymore though I didn´t change anything on the server or the
When I then tried to analyze or dump the database I getan error which
says that psql was not able to laod the postgis-1.5.dll (unknown error
998) which is strange as the dll is located in the directory which is
given in the error message. I also deinstalled postgis and tried to
install it again but then I get the same error message.
Please help me cause I cannot find a solution and I really need the data...
I presume you installed the 32-bit PostgreSQL the second time around you
If not that is probably your problem since PostGIS is not yet supported on
the 64-bit EDB windows builds
(just the 32-bit installers). If you are interested in supporting our
efforts to build a 64-bit windows version then you can contribute to our
Other reasons why you get this error:
1) one of the files postgis-1.5.dll depends on is not there.
common culprits which should be in the bin folder of your PostgreSQL \ bin
libgeos_c-1.dll, libgeos-3-3-2.dll, libproj.dll,libiconv-2.dll,
If all those are present in your PostgreSQL bin, then use dependency walker
to check the dependencies which you can download from here
2) You are using the wrong postgis-1.5.dll -- note that there is a different
version for each version of PostgreSQL. So if you say try to use a 9.0
postgis 1.5 with 9.1 version of PostgreSQL, it won't work.
You can download the one for your install from here and replace the
postgis-1.5.dll if that is the case:
Hope that helps,
Leo and Regina http://www.postgis.us
Dear Leo and Regina,
thanks for your fast answer. Indeed I try to reinstall the postgis-1.5
version (32bit) through the stackbuilder of postgresql 9.1 but now it
always gives me an error that the "template_postgis" database does not
exist. I checked with pgadmin and it is indeed not there but I thought
it would be created in the process of installation?
I mean the template was there before but I deleted it by hand (using
the steps described here http://blog.kimiensoftware.com/2011/03/postgresql-dropping-a[..]
and then I tried to build it from hand using the steps described here http://brandonkonkle.com/blog/2010/jul/19/setting-template_p[..]
but when I run the sql scripts I get alot of erro messages). The
reason was that the geometry and spatial_ref_sys table were not there
anymore. So I guessed it will not work anyway as a template.
Btw the files that the postgis-1.5.dll depends are not there - I
checked with the depencywalker - but I thought they get installed when
I use the stackbuilder or not?
Thanks for your answer in advance.
postgis-users mailing list
Is your old database working again or not?
Yah they do get installed by the stack builder. So strange they did not.
It's possible it sensed you already had postgis installed because its in
your registry and did nothing.
Did you try uninstalling postgis first? You should see it listed in control
panel / programs or you can just uninstall it with
the uninstall file in postgresql folder.
Then try reinstalling again. Alternatively -- and a safer route if you have
data, just use the batch script in the download zip file from postgis site.
It is set to create a template database as I recall.
In theory you don't need a template database, and moving forward (9.1
2.0, we aren't going to bother with a tempalte_postgis, because its much
easier to use CREATE EXTENSION).
yeah I deinstalled postgis through control panel/programs and the
stackbuilder also says, that is not installed. Strange thing is that
even the template_postgis is not there anymore the installer warns me
that if I install postgis he will overwrite the template_postgis
table. So somehow it is still there also I do not see it?
Ah and no my old database is not working but also when I try to
install a new postgresql/postgis (maybe 9.0 or 8.4 with postgis 1.5.3
or 1.4.2) I get the same error with the template_postgis table
postgis-users mailing list
You might have multiple versions of PostgreSQL running on your server.
Maybe one of them already has postgis 1.5 and you didn't change the port to
the new one you have. It usually picks up the port from the registry via
stackbuilder, but sometimes it doesn't and you have to manually change
Check the folders:
C:\Program Files (x86)\PostgreSQL (32-bit ones get installed here)
C:\Program Files\PostgreSQL (64 bit versions get installed here)
We have 4 running on my windows server so I have subfolders in the x86 (8.4,
and a 9.0, 9.1 in my 64-bit folder.
All running on different ports.
ok I checked the ports and they were all ok - in fact I deinstalled
the other postgresql installations on the server. Now the
template_postgis gets created but I have the same error as before that
the postgis-1.5.dll can´t be loaded.
I ran also the batch file that I downloaded from the postgis site but
the geometry and spatial_ref_sys tables don´t get created (I only see
lots of error messages). I also checked that the referenced files are
in the bin-folder (libgeos_c-1.dll, libgeos-3-3-2.dll,
libproj.dll,libiconv-2.dll, libxml-2-2.dll) and indeed they are but
why can´t the dependencywalk program find them (see attached file)? If
I copy them to the lib-folder they get found but then I have other
dependencies that are missing - the same is true if I copy the
postgis-1.5.dll to the bin-folder. But I guess the should be
I have no glue what I should do now ... Thanks for your help.
Mmmhhh maybe another thing: I also checked the registry and under
HKEY_CURRENT_USER\Software\pgAdmin III\Servers I find three identical
server 1, 2 and 3 with the exact same databases. Is that correct? But
maybe that has nothing to do with the error message I get ...
postgis-users mailing list
That shouldn't matter. That just affects what you see in pgAdmin.
As far as dependency walker goes those errors are fine since the lib becomes
part of path when postgresql launches so it can find it then.
Only other thoughts
1) is to look in the pg_log folder in your data folder at the error. That
sometimes gives more clues.
2) In your services, verify the executable and data path are what you think
For example our 9.1 services path to executable looks like this when we go
to control -> Services
C:/Program Files (x86)/PostgreSQL/9.1/bin/pg_ctl.exe runservice -N
"postgresql-9.1" -D "E:/PGData91X32" -w
3) Shut off the service and try to start postgres from the console instead
of the service
use pg_ctl -D path to your data folder.
"C:/Program Files (x86)/PostgreSQL/9.1/bin/pg_ctl.exe" -D "E:/PGData91X32"
You also want to check your postgresql.conf file that is located in your
datafolder to make sure it is listening on the port you think it is.
Aside from that its really hard to diagnose without seeing your computer.
thank you very much for your help. Now it works again - I also could
install postgis with the stackbuilder again with no problems (before
that I was already able to view and dump my database also again with
It seems restarting the service was the key - too bad I didn´t thought
about that earlier but as the database itself was running fine (and
only the tables with the geography datatype were not working), I
didn´t thought that would be the problem. The only other thing I did
was to put the bin-/lib-folder in the PATH variable but I guess that
doesn´t make a difference.
Btw I did restart it through the windows menu as restarting the
service with the console led to a 1063 error. Anyway it works now -
though I am still not sure what caused the problem in the first place.
postgis-users mailing list
That's good to hear. It's possible that the new geos couldn't be overwritten
before since it is sometimes in use and 1.5 did come with a slightly newr
one. Usually you get an error about that though and then you have to
restart the service to unlock it. Someitmes the old dll is jus tloaded in
memory too. :)