From: Dustin P. <dparker@Forwardslope.com> - 2010-03-22 03:16:27
|
We have mixed case table names in PostGIS, too, so the generated schemas look good :) -- Dustin Parker Cell: 619 277 2591 On Mar 21, 2010, at 19:51, "Andrea Aime" <aa...@op...> wrote: > Dustin Parker ha scritto: >> Hello, >> Since we have so many different types in our database, I just decided >> to name the PostGIS schemas after our XML namespaces. Most things in >> Geoserver/GeoTools work fine except for the >> MetadataTablePrimaryKeyFinder, which fails with SQL syntax errors >> because of the ":" character here on lines 117-124: >> StringBuffer sb = new StringBuffer(); >> sb.append("SELECT * FROM "); >> if (metadataSchema != null) { >> sb.append(metadataSchema); >> sb.append("."); >> } >> sb.append(tableName); >> rs = st.executeQuery(sb.toString()); >> (metadataSchema is, e.g., "http://www.example.com/") > >> A simple workaround is to just specify a schema component on the JDBC >> factory parameter, like "public.pk_metadata". This also means that >> the >> default PK metadata table won't be found and that the factory >> parameter >> is necessary. > > Looks like a matter of proper escaping. We have methods in SQLDialect > that factor out the proper escaping code for table and schema names, > so I guess we should build the MetadataTablePrimaryKeyFinder by > passing > in the associated SQLDialect. > > In fact I think it's just a matter of adding double quotes before > and after the schema and table name.... hmmm... or maybe just the > schema, afaik when I did that I avoided adding quotes around the names > to avoid make the metadata table lookup case sensitive. > > Cheers > Andrea > > -- > Andrea Aime > OpenGeo - http://opengeo.org > Expert service straight from the developers. |