db_table with schema name does not work on PostgreSQL
|Reported by:||Owned by:||Adrian Holovaty|
|Component:||Database layer (models, ORM)||Version:|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If I give Django a db_table of "loadtest.machine", it passes to PostgreSQL "loadtest.machine", in quotes. PostgreSQL wants "loadtest"."machine". There needs to be some way of passing in a schema-qualified table name, such as:
- pass in the latter, at the expense of not supporting an actual '.' in the name).
- support a db_schema attribute, maybe, so there's no ambiguity.
My code used to work, but Django added some quoting.
Here's an example of the errors pgsql gives:
loadtest=# select count(*) from "loadtest"."experiment"; count ------- 25 (1 row) loadtest=# select count(*) from "loadtest.experiment"; ERROR: relation "loadtest.experiment" does not exist