ArcCatalog Calling PostGIS Function in an ESRI Geodatabase

672
4
11-01-2013 06:48 PM
dkav
by
Occasional Contributor
Why is ArcCatalog calling a PostGIS function in an ESRI Geodatabase? Our PostgreSQL log is covered with the following error -

2013-11-01 19:38:26 PDT ERROR function public.postgis_lib_version() does not exist at character 8
2013-11-01 19:38:26 PDT HINT No function matches the given name and argument types. You might need to add explicit type casts.

Do I have to enable the PostGIS extension for an ESRI Geodatabase? If so, why?

I am running ArcGIS 10.2. Geodatabase is 10.2 too.

Thanks!
0 Kudos
4 Replies
VinceAngelo
Esri Esteemed Contributor
No, PostGIS is not necessary, but if it's available, it would be an option. 

It's more likely that you have a partial PostGIS install in the template
database, and that's what's causing these errors.

- V
0 Kudos
dkav
by
Occasional Contributor
That is not the issue. I can enable and disable the PostGIS extension without any problems. The function is called when a connection is opened in ArcCatalog. Its very repeatable. The error is not reported if I enable the PostGIS extension. It seems like a redundant call made by ArcGIS. At worse it should at least check if the PostGIS extension is enabled before calling the function.

No, PostGIS is not necessary, but if it's available, it would be an option. 

It's more likely that you have a partial PostGIS install in the template
database, and that's what's causing these errors.

- V
0 Kudos
KasiaTuszynska
New Contributor III
dkav,
Upon establishing a connection, the sde code determines what if any version of PostGIS is installed on the Postgres instance, the message you posted, is an indication that no PostGIS version is installed. It does not mean that you need to install it nor that anything is broken it is just a bit of discovery by our code when connecting.
Sincerely,
Kasia
0 Kudos
dkav
by
Occasional Contributor
To avoid "errors" being logged, how about using a simple function like the following.

CREATE OR REPLACE FUNCTION PostGIS_chk()
RETURNS TEXT AS $$
DECLARE postgis_version TEXT DEFAULT '';
BEGIN
IF EXISTS (SELECT extname FROM pg_extension WHERE extname='postgis') THEN
  SELECT PostGIS_full_version() INTO postgis_version;
END IF;
RETURN postgis_version;
END;
$$  LANGUAGE plpgsql

Thanks,
Darren


dkav,
Upon establishing a connection, the sde code determines what if any version of PostGIS is installed on the Postgres instance, the message you posted, is an indication that no PostGIS version is installed. It does not mean that you need to install it nor that anything is broken it is just a bit of discovery by our code when connecting.
Sincerely,
Kasia
0 Kudos