Where most other databases use CURRENT_SCHEMA, HP Vertica uses a SEARCH_PATH. SEARCH_PATH allows users to list multiple schemas for which an object should be searched during a particular session.
So if my current session’s SEARCH_PATH is:
Schema1, Schema2, public
If I run SQL “SELECT * FROM FOO;” over that session, Vertica will attmpt to resolve the schema of FOO by looking for Schema1.FOO, then Schema2.FOO, and finally, public.FOO.
Toad Data Point has 3 bugs in how it handles Vertica’s SEARCH_PATH feature.
Bug#1 (minor): Connecting Toad Data Point to a Vertica Database requires an ODBC connection. One of the properties of a Toad Data Point ODBC connection is “Database”. For Vertica ODBC connections, this is an “invalid option” bug. For Vertica connections, the choice of database is built into ODBC source definition (the database is part of the ODBC URL). This option should either be invisible, or as a hard-coded/non-editable field that just lists echos the database portion of the Vertica connection URL.
Bug #2 (minor): In addition to being unnecessary, this “Database” field is also mislabeled. As evidenced by the dropdown list after clicking the […] button, the field is actually referring to “the default schema that is set after connection is established”. This bug (the label says Database when it means Default Schema) can be verified directly: when configuring a new Vertica ODBC connection in Toad Data Point, when I click the “…” next to “Database”, the drop-down of values is actually all the schemata in the Vertica database (not the “list” of databases which, as noted in Bug 1, can only be database string in the URL).
Bug #3 (major) The real problem is how Toad handles the “default schema” for ODBC-Vertica connections. Say I choose “Schema2” for the the “Database” option of a Vertica connection. Based on this setting, when I open a new connection, Toad sends the following SQL string over ODBC: “SET SEARCH_PATH=Schema2”.
What makes Bug#3 such a nasty bug is that
- This command gets run (automatically) after all other connection settings are applied. So if my Vertica user account has default SEARCH_PATH of “Schema1, Schema2, Schema3, public”, that default is overwritten by Toad Data Point to just “Schema2”. Even if I make my desired SEARCH_PATH using the ODBC Connection String, this bug overwrites that value.
In other words, if I put “ConnSettings=SET SEARCH_PATH TO Shema1, Schema2, Schema3, public” in Connection String, and set that same SEARCH_PATH for my user account, after I connect to Vertica, and run SHOW SEARCH_PATH;, I will see the search-path is just “Schema2”. The behavior can also be observed after connection is established. If the “default schema” (hover-text = “Select the schema/instance to associate with the statement”) is changed from Schema2 to Schema3, behind the scenens the command “SET SEARCH_PATH=Schema3” is sent.
- This behavior cannot be disabled. This is my main beef. The behavior pretty much completely prevents using SEARCH_PATH functionality in Toad Data Point; which effectively eliminates any ability to use Vertica’s SEARCH_PATH feature - a sufficiently large obstacle to entice me to find an alternate IDE for Vertica analysis (and recommend the same to colleagues).