[postgis-devel] [postgis-tickets] r17049 - Replace pg_constraint.consrc for pg_get_constraintdef fix for topology

Sandro Santilli strk at kbt.io
Thu Nov 22 04:11:14 PST 2018


On Wed, Nov 21, 2018 at 11:33:52AM +0000, Regina Obe wrote:
> Author: robe
> Date: 2018-11-21 23:33:52 -0800 (Wed, 21 Nov 2018)
> New Revision: 17049
> 
> Modified:
>    trunk/topology/topology.sql.in
> Log:
> Replace pg_constraint.consrc for pg_get_constraintdef  fix for topology
> References #4231 for PostGIS 3.0.0
> 
> Modified: trunk/topology/topology.sql.in
> ===================================================================
> --- trunk/topology/topology.sql.in	2018-11-22 06:46:54 UTC (rev 17048)
> +++ trunk/topology/topology.sql.in	2018-11-22 07:33:52 UTC (rev 17049)
> @@ -829,7 +829,8 @@
>      --c.consrc src,
>      regexp_matches(c.consrc,
>        '\.topology_id = (\d+).*\.layer_id = (\d+).*\.type = (\d+)') inf
> -  FROM pg_constraint c, pg_class r, pg_namespace n
> +  FROM (SELECT conname, connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
> +		    FROM pg_constraint) AS c, pg_class r, pg_namespace n
>    WHERE c.conname LIKE 'check_topogeom_%'
>      AND r.oid = c.conrelid
>      AND n.oid = r.relnamespace

This change looks suspicious to me.
I usually try to avoid subqueries, what's the rationale
for that ?

--strk;


More information about the postgis-devel mailing list