Skip to content

Commit

Permalink
filtering system schemas from all tables and all schemas queries (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal authored Nov 30, 2023
1 parent f2cf96a commit ab3ec4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flow/cmd/peer_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (h *FlowRequestHandler) GetSchemas(

defer peerPool.Close()
rows, err := peerPool.Query(ctx, "SELECT schema_name"+
" FROM information_schema.schemata;")
" FROM information_schema.schemata WHERE schema_name !~ '^pg_' AND schema_name <> 'information_schema';")
if err != nil {
return &protos.PeerSchemasResponse{Schemas: nil}, err
}
Expand Down Expand Up @@ -106,7 +106,7 @@ func (h *FlowRequestHandler) GetAllTables(

defer peerPool.Close()
rows, err := peerPool.Query(ctx, "SELECT table_schema || '.' || table_name AS schema_table "+
"FROM information_schema.tables;")
"FROM information_schema.tables WHERE table_schema !~ '^pg_' AND table_schema <> 'information_schema'")
if err != nil {
return &protos.AllTablesResponse{Tables: nil}, err
}
Expand Down

0 comments on commit ab3ec4c

Please sign in to comment.