<div dir="ltr">Hi,<div><br></div><div>I can confirm that this fixes issue for my case. Thank you very much!</div><div><br></div><div>Br, Ari</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">su 27.7.2025 klo 9.19 Jackie Ng via mapguide-users (<a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>) kirjoitti:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Unfortunately, I still could not get this "class not found" to trigger with the instructions given.<br><br>Nevertheless I looked at the code in question and can see how the way the query is currently constructed would be incorrect in certain cases.<br><br>So as much as it pains me, I have made a *theoretical* fix and will have to ask you to confirm if this issue is resolved by it.</div><div><br></div><div>The code patch in question is here:<br><br><a href="https://trac.osgeo.org/fdo/attachment/ticket/1003/postgis-matview.patch" target="_blank">https://trac.osgeo.org/fdo/attachment/ticket/1003/postgis-matview.patch</a><br><br>A compiled PostGIS provider with these code changes can be downloaded here:<br><br><a href="https://download.osgeo.org/mapguide/releases/4.0.0/Beta3/Patches/PostgreSQLProvider.zip" target="_blank">https://download.osgeo.org/mapguide/releases/4.0.0/Beta3/Patches/PostgreSQLProvider.zip</a></div><div><br></div><div>Download and overwrite the existing PostgreSQLProvider.dll in your existing MG 4.0 Beta 3 install.</div><div><br></div><div>Please do let me know if this resolves your issue as soon as possible. Thanks.</div><div><br></div><div>- Jackie</div><div><br></div><div>You wrote:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><pre style="color:rgb(0,0,0)">Hi,</pre></div></div><div><div><pre style="color:rgb(0,0,0)">I think that error occurs only when you are viewing data </pre></div></div><div><div><pre style="color:rgb(0,0,0)">I think that error occurs only when you are viewing data as layer. Here's</pre></div></div><div><div><pre style="color:rgb(0,0,0)">steps for replicating that.</pre></div></div><div><div><pre style="color:rgb(0,0,0)">1. Start </pre></div></div><div><div><pre style="color:rgb(0,0,0)">1. Start with empty database with postgis extension created.</pre></div></div><div><div><pre style="color:rgb(0,0,0)">2. Create normal view with this command:</pre></div></div><div><div><pre style="color:rgb(0,0,0)">CREATE VIEW public.v_test</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> AS</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> WITH point_series AS (</pre></div></div><div><div><pre style="color:rgb(0,0,0)">         SELECT generate_series('-20'::integer::numeric, 20::numeric, 0.5)</pre></div></div><div><div><pre style="color:rgb(0,0,0)">AS point_values</pre></div></div><div><div><pre style="color:rgb(0,0,0)">        )</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> SELECT row_number() OVER () AS id,</pre></div></div><div><div><pre style="color:rgb(0,0,0)">    st_setsrid(st_point(point_values::double precision,</pre></div></div><div><div><pre style="color:rgb(0,0,0)">point_values::double precision), 4326) AS geom</pre></div></div><div><div><pre style="color:rgb(0,0,0)">   FROM point_series a;</pre></div></div><div><div><pre style="color:rgb(0,0,0)">3. Create database connection in Mapguide and layer from view </pre></div></div><div><div><pre style="color:rgb(0,0,0)">3. Create database connection in Mapguide and layer from view above and and</pre></div></div><div><div><pre style="color:rgb(0,0,0)">that to Map.</pre></div></div><div><div><pre style="color:rgb(0,0,0)">4. Browse Map and everything is fine.</pre></div></div><div><div><pre style="color:rgb(0,0,0)">5. Create materialized view to database. It should work with previous</pre></div></div><div><div><pre style="color:rgb(0,0,0)">examples too but you can also create materialized view with geometry column</pre></div></div><div><div><pre style="color:rgb(0,0,0)">in it.</pre></div></div><div><div><pre style="color:rgb(0,0,0)">CREATE MATERIALIZED VIEW public.mv_test2</pre></div></div><div><div><pre style="color:rgb(0,0,0)">AS</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> WITH point_series AS (</pre></div></div><div><div><pre style="color:rgb(0,0,0)">         SELECT generate_series('-20'::integer::numeric, 20::numeric, 0.5)</pre></div></div><div><div><pre style="color:rgb(0,0,0)">AS point_values</pre></div></div><div><div><pre style="color:rgb(0,0,0)">        )</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> SELECT row_number() OVER () AS id,</pre></div></div><div><div><pre style="color:rgb(0,0,0)">    st_setsrid(st_point(point_values::double precision,</pre></div></div><div><div><pre style="color:rgb(0,0,0)">point_values::double precision), 4326) AS geom</pre></div></div><div><div><pre style="color:rgb(0,0,0)">   FROM point_series a;</pre></div></div><div><div><pre style="color:rgb(0,0,0)">6. Refresh database datasource in Mapguide so it will get info about new</pre></div></div><div><div><pre style="color:rgb(0,0,0)">materialized view.</pre></div></div><div><div><pre style="color:rgb(0,0,0)">7. Browse Map for awhile. Layer will be lost and visible again and error</pre></div></div><div><div><pre style="color:rgb(0,0,0)">log will have rows showing error  Class 'public:v_test' not found</pre></div></div><div><div><pre style="color:rgb(0,0,0)">8. Delete materialized view from database, refresh datasource and layer</pre></div></div><div><div><pre style="color:rgb(0,0,0)">will work again when Browsing map.</pre></div></div><div><div><pre style="color:rgb(0,0,0)">If you </pre></div></div><div><div><pre style="color:rgb(0,0,0)">If you run query shown in ticket with correct parameters it will return</pre></div></div><div><div><pre style="color:rgb(0,0,0)">only table or normal view with same schema and name as in parameters and</pre></div></div><div><div><pre style="color:rgb(0,0,0)">all materialized views. If you add these conditions to where part of second</pre></div></div><div><div><pre style="color:rgb(0,0,0)">select after union query will return only wanted rows. Values should be the</pre></div></div><div><div><pre style="color:rgb(0,0,0)">same as placed to first select.</pre></div></div><div><div><pre style="color:rgb(0,0,0)"></pre></div></div><div><div><pre style="color:rgb(0,0,0)">AND ns.nspname='public' AND c.relname='v_test'</pre></div></div><div><div><pre style="color:rgb(0,0,0)"></pre></div></div><div><div><pre style="color:rgb(0,0,0)"></pre></div></div><div><div><pre style="color:rgb(0,0,0)">SELECT  t.table_schema  || '.' || t.table_name AS name,</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> lower(t.table_type) AS type,  convert_to(t.table_schema,'UTF8') as</pre></div></div><div><div><pre style="color:rgb(0,0,0)">collate_schema_name,  convert_to(t.table_name,'UTF8') as collate_table_name</pre></div></div><div><div><pre style="color:rgb(0,0,0)"></pre></div></div><div><div><pre style="color:rgb(0,0,0)">FROM information_schema.tables AS t</pre></div></div><div><div><pre style="color:rgb(0,0,0)">WHERE t.table_schema not in ( 'information_schema' ,'pg_catalog')  and  (</pre></div></div><div><div><pre style="color:rgb(0,0,0)">(t.table_schema = 'public' and t.table_name = 'v_test') ) AND t.table_type</pre></div></div><div><div><pre style="color:rgb(0,0,0)">IN ('BASE TABLE','VIEW')  AND t.table_name not in ( 'geometry_columns',</pre></div></div><div><div><pre style="color:rgb(0,0,0)">'geography_columns','spatial_ref_sys', 'raster_columns', 'raster_overviews')</pre></div></div><div><div><pre style="color:rgb(0,0,0)">UNION</pre></div></div><div><div><pre style="color:rgb(0,0,0)">SELECT ns.nspname || '.' || c.relname AS name,  'view' AS type,</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> convert_to(ns.nspname,'UTF8') AS collate_schema_name,</pre></div></div><div><div><pre style="color:rgb(0,0,0)"> convert_to(c.relname,'UTF8') AS collate_table_name</pre></div></div><div><div><pre style="color:rgb(0,0,0)">FROM pg_class AS c  JOIN pg_namespace ns ON c.relnamespace = ns.oid</pre></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><pre style="color:rgb(0,0,0)">WHERE c.relkind = 'm' AND ns.nspname='public' AND c.relname='v_test'</pre></div></div><div><div><pre style="color:rgb(0,0,0)">ORDER BY collate_schema_name, collate_table_name ASC;</pre></div></div><div><div><pre style="color:rgb(0,0,0)"></pre></div></div><div><div><pre style="color:rgb(0,0,0)">Br, Ari</pre></div></div></blockquote><div dir="ltr" class="gmail_signature"><div dir="ltr"><div></div></div></div></div>
_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</blockquote></div>