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

when using custom schema relation "gue_jobs" does not exist #31

Open
kulak opened this issue Mar 30, 2021 · 5 comments
Open

when using custom schema relation "gue_jobs" does not exist #31

kulak opened this issue Mar 30, 2021 · 5 comments

Comments

@kulak
Copy link

kulak commented Mar 30, 2021

Worker failed to lock a job level=error worker-pool-id=959ce5 worker-id=959ce5/worker-0 error=could not lock a job (rollback result: ): ERROR: relation "gue_jobs" does not exist (SQLSTATE 42P01)

@kulak
Copy link
Author

kulak commented Mar 30, 2021

I did not have a chance to look deep into it. So, that's just a guess.

When &search_path= method is appended to connection string, it does not impact some of the queries.

@kulak
Copy link
Author

kulak commented Mar 30, 2021

Test cases might be giving false positive, because there is table in "public" schema. It is something that I was not sure how to address in abandoned #28.

@vgarvardt
Copy link
Owner

Can you reproduce this using test? E.g. add one more DB to services specifically for the test purpose and cover the scenario that should fail.

@kulak
Copy link
Author

kulak commented Mar 31, 2021

I am not sure how much I am interested in troubleshooting of this case. My fork https://github.com/Kulak/gue/commits/feat-schema with explicit schema implementation does not have an issue like that.

Unfortunately I did not think about a chance to re-introduce #28 and added package rename yesterday. It is also how I know that #28 works.

@dosco
Copy link

dosco commented Feb 18, 2022

You have to set the schema on Postgres when opening a new connection. The schema is also called search_path. For example when using the pgx driver you can do this

config, _ := pgx.ParseConfig("host=local port=5432 user=blah password=blah dbname=db sslmode=disable")
config.RuntimeParams = map[string]string{
"application_name": "my app",
"search_path":  "custom_schema_name",
}

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

No branches or pull requests

3 participants