Fix FOUND in _CDB_Geometry_SRID #141

This commit is contained in:
Rafa de la Torre 2015-09-14 11:18:12 +02:00
parent e546c15770
commit 9ec24c1aff

View File

@ -519,16 +519,16 @@ DECLARE
BEGIN
RAISE DEBUG 'CDB(%): %', '_CDB_Geometry_SRID', 'entered function';
EXECUTE Format('SELECT ST_SRID(%I) AS srid FROM %s LIMIT 1', columnname, reloid::text)
INTO rec;
IF FOUND THEN
IF rec IS NOT NULL THEN
RETURN rec.srid;
END IF;
RETURN 0;
END;
$$ LANGUAGE 'plpgsql';