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

Problems using seperate postgres reader/writer hosts with pgstac #370

Closed
nkleinbaer opened this issue Mar 4, 2022 · 1 comment
Closed
Labels

Comments

@nkleinbaer
Copy link

I'm running into problems when using pgstac with separate reader and writer hosts (in my case an Aurora cluster). Search endpoints return an error similar to the following:

 cannot execute SELECT FOR UPDATE in a read-only transaction

The issue appears to be that the SQL functions defined by pgstac for searching perform operations that require write access (select for update, create temp table, etc). But, the search endpoints connect to the DB through the readpool

request: Request = kwargs["request"]
pool = request.app.state.readpool

This is not a problem when a single host is used for both read and write, as in the docker compose yaml.

- POSTGRES_HOST_READER=database
- POSTGRES_HOST_WRITER=database

When POSTGRES_HOST_READER points to a host that is truly read-only, however, this becomes a problem.

@duckontheweb
Copy link
Contributor

This issue is now being tracked by stac-utils/stac-fastapi-pgstac#4

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