Description:
In many of the situations where one might use a merge table it would be useful to be able to return the source table name for the rows returned.
This would mean that is would not be necessary to store redundant information in the underlying tables. For example, consider two tables that separately hold import and export data. It would be nice to be able to do this:
select merge_table_name() as type, value, description from merge_imports_exports;
Currently it is necessary to have an additional column (e.g. is_import BOOL) in both tables where the column will always be 1 for imports and always be 0 for exports.
For large data sets eliminating this redundant data would reduce the disc space required and presumably increase performance too.
How to repeat:
n/a