On 21/06/2025 20:10, Denis Simonov wrote:
> I don't consider people stupid by default, and therefore I don't believe
> that they will twist knobs that they don't understand.
I have worked in customer support, IT support, and answered hundreds if
not thousands questions here and elsewhere, and I'm not that optimistic.
> You can change the search path only if the driver, ORM, application and
> query generator support schemas.
Not really, as long as the driver supports it, and you can control the
configuration of the database connection (e.g. in Java, the JDBC URL),
then you can configure the search path to you hearts content, even if
the application, etc., is not schema-aware.
> And don't make something magical out of RDB$DATABASE. Changing the
> search path will break a lot in other places if the system can't work
> with schemas. Because any query generator works with system tables.
> Moreover, queries to system tables must be written taking into account
> schemas. Otherwise, it can be broken in no time.Not all query generators query metadata tables directly (e.g. they use a
common API, like JDBC's `DatabaseMetaData`, which I am updating right
now for Jaybird), or even at all (e.g. they have a code-first model of
the database, or some other sort of description of the database).
For example, Hibernate will emulate table value constructors using union
all and RDB$DATABASE for Firebird, and it also uses RDB$DATABASE in some
other places. Now, Hibernate is probably a "bad example", as I help
maintain its Firebird dialect, so I'll soon be working to write in
additional Firebird 6 support for it.
> Try creating objects with the same name in two schemas, for example, a
> table. And then try to extract the metadata of this table from the
> system tables with a query that does not take into account schemas. It
> will be a lot of fun.
See my previous point, the tool might be using a common API to get its
information, and for example the JDBC API itself does support schemas,
so as long as the driver provides the right information, the tool might
happily work until it generates a query involving RDB$DATABASE as that
table name might be hardcoded somewhere in its dialect for Firebird.
Mark
--
Mark Rotteveel