show_columns.td 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. $ postgres-connect name=mz_support url=postgres://mz_support:materialize@${testdrive.materialize-internal-sql-addr}
  10. $ postgres-connect name=mz_system url=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  11. > CREATE TABLE t(a int)
  12. > SHOW COLUMNS FROM t
  13. a true integer ""
  14. $ postgres-execute connection=mz_support
  15. SHOW COLUMNS FROM t
  16. # enable RBAC
  17. $ postgres-execute connection=mz_system
  18. ALTER SYSTEM SET enable_rbac_checks=true;
  19. $ postgres-execute connection=mz_system
  20. CREATE TABLE priv(a int)
  21. $ postgres-execute connection=mz_system
  22. REVOKE SELECT ON TABLE priv FROM materialize
  23. ! SELECT * from priv;
  24. contains:permission denied for TABLE "materialize.public.priv"
  25. > SHOW COLUMNS FROM priv
  26. a true integer ""
  27. # Make sure we can't exfiltrate data by supplying a where expression
  28. # that references the underlying table
  29. ! SHOW COLUMNS FROM priv WHERE char_length(name) = any (select * from priv)
  30. contains:permission denied for TABLE "materialize.public.priv"
  31. $ postgres-execute connection=mz_support
  32. SHOW COLUMNS FROM priv