Changeset: bb5434f29045 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb5434f29045
Modified Files:
        geom/monetdb5/geom_upgrade.c
Branch: default
Log Message:

Update upgrade code for geom.


diffs (38 lines):

diff --git a/geom/monetdb5/geom_upgrade.c b/geom/monetdb5/geom_upgrade.c
--- a/geom/monetdb5/geom_upgrade.c
+++ b/geom/monetdb5/geom_upgrade.c
@@ -256,24 +256,17 @@ geom_sql_upgrade(int olddb)
                        "\tproj4text VARCHAR (2048)\n"
                        ");\n"
                        "GRANT SELECT ON spatial_ref_sys TO PUBLIC;\n"
-                       "create view geometry_columns as\n"
-                       "\tselect e.value as f_table_catalog,\n"
+                       "create view sys.geometry_columns as\n"
+                       "\tselect cast(null as varchar(1)) as 
f_table_catalog,\n"
                        "\t\ts.name as f_table_schema,\n"
-                       "\t\ty.f_table_name, y.f_geometry_column, 
y.coord_dimension, y.srid, y.type\n"
-                       "\tfrom schemas s, environment e, (\n"
-                       "\t\tselect t.schema_id,\n"
-                       "\t\t\tt.name as f_table_name,\n"
-                       "\t\t\tx.name as f_geometry_column,\n"
-                       "\t\t\thas_z(info)+has_m(info)+2 as coord_dimension,\n"
-                       "\t\t\tsrid, get_type(info, 0) as type\n"
-                       "\t\tfrom tables t, (\n"
-                       "\t\t\tselect name, table_id, type_digits AS info, 
type_scale AS srid\n"
-                       "\t\t\tfrom columns\n"
-                       "\t\t\twhere type in ( select distinct sqlname from 
types where systemname='wkb')\n"
-                       "\t\t\t) as x\n"
-                       "\t\twhere t.id=x.table_id\n"
-                       "\t\t) y\n"
-                       "\twhere y.schema_id=s.id and e.name='gdk_dbname';\n"
+                       "\t\tt.name as f_table_name,\n"
+                       "\t\tc.name as f_geometry_column,\n"
+                       "\t\tcast(has_z(c.type_digits) + has_m(c.type_digits) 
+2 as integer) as coord_dimension,\n"
+                       "\t\tc.type_scale as srid,\n"
+                       "\t\tget_type(c.type_digits, 0) as type\n"
+                       "\tfrom sys.columns c, sys.tables t, sys.schemas s\n"
+                       "\twhere c.table_id = t.id and t.schema_id = s.id\n"
+                       "\t  and c.type in (select sqlname from sys.types where 
systemname in ('wkb', 'wkba'));\n"
                        "GRANT SELECT ON geometry_columns TO PUBLIC;\n"
                        "copy 3911 records into spatial_ref_sys from stdin 
using delimiters '|';\n"
                        
"3819|EPSG|3819|GEOGCS[\"HD1909\",DATUM[\"Hungarian_Datum_1909\",SPHEROID[\"Bessel
 
1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408],AUTHORITY[\"EPSG\",\"1024\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3819\"]]|+proj=longlat
 +ellps=bessel +towgs84=595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408 
+no_defs\n"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to