-
Notifications
You must be signed in to change notification settings - Fork 40
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
stac-fastapi-pgstac doesn't work with beta version of postgres 17 (postgis/postgis:17beta3-master) #309
Comments
@MathewNWSH I see you're using the latest version of pgstac. can you try with |
unfortunately response remains the same:
|
@MathewNWSH I'm seeing some errors in the logs
|
Hey @vincentsarago
|
My first guess would be that the search_path is not getting set correctly when connecting to the database. Can you try setting the search_path as a setting on the role that you are logging in as? |
Hey @bitner :) as you suggested I tried: and it helped in terms of inserting the data into / editing data in pgstac. So no such error is received: But a response remains the same: {
"type": "FeatureCollection",
"links": [
{
"rel": "collection",
"type": "application/json",
"href": "https://stac-cdse.eu/collections/sentinel-2-l2a"
},
{
"rel": "parent",
"type": "application/json",
"href": "https://stac-cdse.eu/collections/sentinel-2-l2a"
},
{
"rel": "root",
"type": "application/json",
"href": "https://stac-cdse.eu/"
},
{
"rel": "self",
"type": "application/geo+json",
"href": "https://stac-cdse.eu/collections/sentinel-2-l2a/items"
}
],
"features": [],
"numberReturned": 0
} The data is alright - items and collection work perfectly on postgres 16. |
I also tested other versions of stac-fastAPI (2.4.11), and the problem occurs there as well. I guess it's only a pgstac problem. |
It is confirmed by using pgstac's search function which returns 0 features: test data: pypgstac load collections https://s3.fra1-2.cloudferro.com/swift/v1/poland-stac/collection-sentinel-2-l2a.json
pypgstac load items https://s3.fra1-2.cloudferro.com/swift/v1/poland-stac/poland-data.json search function: select * from search('{"collections": ["sentinel-2-l2a"], "limit": 1000, "conf": {"nohydrate": false}, "fields": {"include": [], "exclude": []}, "filter-lang": "cql-json"}'); the result: {
"type": "FeatureCollection",
"links": [
{
"rel": "root",
"href": ".",
"type": "application/json"
},
{
"rel": "self",
"href": "./search",
"type": "application/json"
}
],
"features": [],
"numberReturned": 0
} |
The issue is the materialized view partition_steps Select from CREATE VIEW returns proper partition name items_4, but in the view I can see schema name attached _pgstac.items_4, values doesn't match and the join in chunker function between t and partition_steps returns no rows as t.p = name cannot match due to schema on one side of the query. I enforced good name by getting the partition name after the last dot and it started to work. Here is the fix:
|
as this is a pgstac issue, I've transferred the issue here 🙏 |
fast api doesn't load items, even if data is loaded successful to pgstac deployed on postgres 17:
Deployment method:
When using
postgis/postgis:16-master
everything works like a charm, when using postgres 17, I needed to updat/usr/local/lib/python3.10/dist-packages/pypgstac/db.py
:Then everything seemed fine but after trying to access collection sentinel-2-l1c item response returned 0 features. On postgres 16 there is no such problem.
The text was updated successfully, but these errors were encountered: