v_internal.vs_view_tables incorrect data on schemes
ilya2
✭
select t2.oid is not null is_not_null, count(*) cnt from v_internal.vs_view_tables t1 left join vs_schemata t2 ON reference_schema_id = oid group by 1 order by 2 desc;
is_not_null|cnt | -----------|----| false |6337| true | 923|
for this reason, incorrect - view_tables
0
Answers
Could you please provide more description? Is the query showing wrong count of schemas?
This request is made on a replica cluster. Part of the schemes in vs_view_tables have id, as on master cluster
view_tables gives many tables where the scheme is not put down
@ilya2 -
It is possible to have a view reference a schema that does not exist. In that case the view is invalid but the meta-data is still stored in the VS_VIEW_TABLES system table...
Example:
dbadmin=> CREATE SCHEMA nada;
CREATE SCHEMA
That's just the point that schemes exist and I can execute view.
The problem is observed only with the view, which were created on the master and were replicated to the replica. There are view immediately created on the replica, then there are no problems
@Jim_Knicely
true |false |5954|