-
Notifications
You must be signed in to change notification settings - Fork 825
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
auto-detection of postgres primary key field #804
Comments
[springmeyer] see also #821 for sqlite |
|
re-opening, there was a flaw in this work that breaks the common and widespread usage of subquery syntax for rendering (where a primary key/id field is rarely used). Basically the problem is that its common for subqueries to be written like |
…t_key_field' is set to true - maintains current behavior - refs #804
b7f714f - rolls back to current behavior whereby no primary key will be autodetected (and added to the final query) unless explicitly requested. closing. |
With postgres, a
key_field
provided by the user is currently necessary for ensuring that the postgis plugins feature.id() is globally unique. When not provided the feature_count is simply incremented for each query and used to populate the feature id value for each feature (so feature id's are not unique across queries).Ideally we could support auto-detection of primary key so that we can promise, when possible, globally unique feature id's.
Since globally unique primary keys are not needed for normal rendering usage the current behavior (of not requiring a primary key and simply incrementing the feature counter) will be maintained (even though this is unique behavior to postgis.input).
But a new option
autodetect_key_field
will be added that will trigger the autodetection behavior and then mapnik will throw if no valid primary key can be detected (and if none is supplied).The text was updated successfully, but these errors were encountered: