Closed timbunce closed 8 years ago
@timbunce - two things to try:
--loader-option qualify_objects=1
--connect-option on_connect_do='SET search_path ...'
Let me know if either of those work...
The first option worked (which is good as the second would be breaking encapsulation). I presume you'll make qualify_objects the default now?
Excellent, I was hoping it would... What I think I'll do is make it the default when db_schema is set, the reason being that turning it on across the board would make the schema classes less portable (and this code is shared by rdbic and the normal rapidapp.pl bootstrap). Let me know if you disagree. Otherwise, I'll ship a new release to CPAN today
Seems like a reasonable approach. Thanks.
We have a schema called 'amq' which contains a table called 'messages' and there's another table with the same name in the default schema ('public').
I launched rdbic.pl with the
--loader-option db_schema=amq
option and it correctly displayed the list of tables in the amq schema. When I tried to access themessages
table it failed with this error:I'm believe the cause of this is that the table name gets looked up in the public schema first and then the amq schema. So when referring to just 'messages' it's finding the one in public instead of the one in amq. (This search behaviour is defined by the Postgres SET search_path ... configuration option.)
The right fix would be to always include the schema name with the table name. (At least for tables not in the default schema, but would be best to do all.)