Skip to content
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

Error during item insert depending on properties datetime value #604

Open
g2giovanni opened this issue Sep 26, 2023 · 2 comments
Open

Error during item insert depending on properties datetime value #604

g2giovanni opened this issue Sep 26, 2023 · 2 comments
Labels

Comments

@g2giovanni
Copy link

Hi,
we have a running Stac Server with PGSTAC backend. When we try to add some Items with POST API /collections/{collection_id}/items we have an error like this:

{ "code": "UndefinedTableError", "description": "relation \"_items_24\" does not exist" }

We noticed that the error happens only when we try to insert an item with a properties datetime smaller than the constraint on the datetime we have on the partitions in the Items table.
For example, we have a collection HPR in our Stac Catalog and for this collection we have the following constraint in the table Items partition:

(datetime >= '2021-01-01 01:00:00+01'::timestamp with time zone) AND (datetime <= '2022-01-01 01:00:00+01'::timestamp with time zone) AND (end_datetime >= '2021-01-01 01:00:00+01'::timestamp with time zone) AND (end_datetime <= '2022-01-01 01:00:00+01'::timestamp with time zone)))

So we cannot insert item with a date smaller than year 2021 (we have the error reported above) but if we change the datetime to 2022 the insert ends without problem.

How can we overcome this problem? Who manages the creation and update of this constraints?

@gadomski
Copy link
Member

cc @bitner ☝🏼

@bitner
Copy link
Collaborator

bitner commented Sep 28, 2023

@g2giovanni can you tell me what version of stac-fastapi and what version of pgstac you are using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants