s_items.sql 735 B

12345678910111213141516171819202122232425262728
  1. -- Copyright Materialize, Inc. and contributors. All rights reserved.
  2. --
  3. -- Use of this software is governed by the Business Source License
  4. -- included in the LICENSE file at the root of this repository.
  5. --
  6. -- As of the Change Date specified in that file, in accordance with
  7. -- the Business Source License, use of this software will be governed
  8. -- by the Apache License, Version 2.0.
  9. -- Get all system objects matching a given pattern.
  10. SELECT
  11. o.id as id,
  12. o.oid as oid,
  13. o.type as type,
  14. o.name as name,
  15. s.name as schema,
  16. 'mz' as database
  17. FROM
  18. mz_objects AS o JOIN
  19. mz_schemas AS s ON (o.schema_id = s.id)
  20. WHERE
  21. o.id like 's%' AND
  22. o.name ilike {name} AND
  23. s.name ilike {schema}
  24. ORDER BY
  25. o.type,
  26. s.name,
  27. o.name;