-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to publish data belonging to all DB schemas #39
Add ability to publish data belonging to all DB schemas #39
Conversation
Move SchemaUnawarePostGISDialect to package org.geotools.data.postgis to be able of overridding the package private method lookupGeometryType()
507b82c
to
c73e5a5
Compare
f640876
to
499e432
Compare
499e432
to
e9a2caa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall
But by reading the PR, there is still something I am unsure of: for now, to circumvent geotools targeting only one schema, we had these SchemaUnaware... classes, and we had to set a search_path with every expected schemas on the user being used for connecting to postgresql. And since the classes have not been removed from the codebase (moved to the org.geotools.data.postgis package), I was wondering if the search_path hack was still necessary ?
...rvices/ogc-features/src/main/java/org/geotools/data/postgis/SchemaUnawarePostGISDialect.java
Show resolved
Hide resolved
I don't think those classes have anything to do with
|
in the current state of what is being deployed, I think we need the custom classes to relax some geotools behaviour AND to set the search path (so that when GT issues SQL queries, there is a chance for postgresql to get a hand on it). I've the feeling that setting the search path is not necessary anymore with your PR. |
EDIT : Ok for those new URLs |
LGTM with my small java background either. I've seen some experimental from lombok
But we will check this in time. Thanks a lot for this huge evolution ! |
Configuration properties to define how to handle multiple PostgreSQL schemas to avoid Collection name clashes.
When running with the
postgis
Spring profile, the default configuration is to serve datafrom all tables in all schemas, except for a few hard-coded schema names:
pg_toast
,pg_catalog
,information_schema
,topology
, andtiger
;and to prefix all feature type names with the schema name and a
:
delimiter.For example, a table
locations
in thepublic
schema will be presented aspublic:locations
.Newly created database schemas, or removed schemas, will be noticed after a period defined by the
postgis.schemas.refresh.interval
config property.If refresh is disabled (i.e.
postgis.schemas.refresh.enabled: false
), there will be no delay in noticing new or deleted PostgreSQL schemas, but the performance will suffer, as the list of schemas will need to be queried upon each API request.Default configuration
The default configuration (i.e. if nothing is explicily configured) is equivalent to the following:
Schema aliasing
Individual schema names can be aliased. For example, to change the prefix of the
ville_Villeneuve-d'Ascq
schema tovilleneuve
, use the following config:This will result in a table locations in that schema to be published as
villeneuve:locations
instead ofville_Villeneuve-d'Ascq:locations
.A single schema can be configured to be un-prefixed, meaning its tables will be published as Collections without a schema prefix.
For example, to remove the
public:
prefix for thepublic
schema, use:If the
*
schema wildcard, or more than one schema is configured withprefix-tables: false
, the application will fail to start.