Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCannot SELECT from schemas other than 'public' even though generated SQL output works #1411
Comments
This comment has been minimized.
dev10
commented
Dec 18, 2017
|
Looks like the PostgreSQL DatabaseError output was misleading. It was connected to the wrong database |
dev10
closed this
Dec 18, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dev10 commentedDec 18, 2017
Setup
Versions
Feature Flags
Problem Description
When trying to load data from from a schema other than the default public, v2 in my case, I get a DatabaseError.
When using the output from debug_query in PostgreSQL directly, it works fine. When querying using both a filtered and unfiltered load call, it fails with a DatabaseError.
Looking at the output of the error, it is quoting the entire "schema.table" instead of "schema"."table"
What are you trying to accomplish?
Load data from domain_registration table located in a schema other than the default public, v2 in my case.
What is the expected output?
Data from domain_registration table in v2 schema
What is the actual output?
Working query from debug_query:
SELECT "v2"."domain_registration"."domain", "v2"."domain_registration"."branch_guids" FROM "v2"."domain_registration" WHERE "v2"."domain_registration"."domain" = $1 -- binds: ["a_domain"]
Get error when actually run:
thread 'db::tests::can_get_all_data_from_schema' panicked at 'Failed to get results: DatabaseError(__Unknown, "relation "v2.domain_registration" does not exist")',
Are you seeing any additional errors?
Steps to reproduce
table.rs:
models.rs:
db.rs:
Checklist