From 9ec24c1affa0e02c84b0419c6d8c4961add9a4e9 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Mon, 14 Sep 2015 11:18:12 +0200 Subject: [PATCH] Fix FOUND in _CDB_Geometry_SRID #141 --- scripts-available/CDB_CartodbfyTable.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts-available/CDB_CartodbfyTable.sql b/scripts-available/CDB_CartodbfyTable.sql index 47d899e..ea3dc1e 100644 --- a/scripts-available/CDB_CartodbfyTable.sql +++ b/scripts-available/CDB_CartodbfyTable.sql @@ -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';