Changing SEARCH_PATH in Postgres does not work intermittently #379

Closed
opened 2016-04-20 06:01:35 +00:00 by ghost · 2 comments
ghost commented 2016-04-20 06:01:35 +00:00 (Migrated from github.com)

Hi,
We are using xorm with great result with Postgres. But we are seeing an issue that happens intermittently. We use non-public schema and run the following command before accessing tables:

store.Engine.Exec("SET SEARCH_PATH TO \"myschema\"")

Sometimes, this does not seem to have any effect and queries keep running against the public schema. This will happen on one computer with same code but not on other computers. Then it will sort of fix on its own. Is there something we are doing wrong? Is xorm reusing connections is some way to cause this?

Thanks.

Hi, We are using xorm with great result with Postgres. But we are seeing an issue that happens intermittently. We use non-public schema and run the following command before accessing tables: `store.Engine.Exec("SET SEARCH_PATH TO \"myschema\"")` Sometimes, this does not seem to have any effect and queries keep running against the public schema. This will happen on one computer with same code but not on other computers. Then it will sort of fix on its own. Is there something we are doing wrong? Is xorm reusing connections is some way to cause this? Thanks.
ghost commented 2016-04-22 10:16:29 +00:00 (Migrated from github.com)

We found out that if we roll back to v0.5.0 for xorm and core package then public schema error goes away. @lunny, can you please revert the schema connection param change and hopefully, we can start using master again.

We found out that if we roll back to v0.5.0 for xorm and core package then public schema error goes away. @lunny, can you please revert the schema connection param change and hopefully, we can start using master again.

@codefx9, I have remove all the schema code and you can test your code to confirm the issue is fixed. And you can reopen it if your issue is still not resolved.

@codefx9, I have remove all the schema code and you can test your code to confirm the issue is fixed. And you can reopen it if your issue is still not resolved.
lunny referenced this issue from a commit 2020-03-09 02:52:44 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#379
No description provided.