Suppose there are two bases, BD1 and BD2. In procedures, functions, triggers there is a call to another database. For example, in the BD1 database procedure, BD2..Table1 is called. There are three types of such bases: base for development - base for testing - production base. They have different names and therefore have to be renamed everywhere, for example, BD2 to BD2_dev, etc. This makes comparing, merging, etc. very difficult. Can you somehow create a synonym for a database or something similar? Tell me, please, good practice in solving such a problem.

  • Databases should be independent. Make one of them - and the problem will disappear. - Pavel Mayorov

1 answer 1

Run three independent database instances. For example, on different ports. Or in different LXC or fashionable docker containers there. In the end, you still have to do it - for example, to check the work on the new version of the DBMS before updating the whole sale.

Immediately, all the difference between the code is reduced only to different parameters for connecting to the database.