types-unsupported.td 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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. > CREATE SECRET pgpass AS 'postgres'
  10. > CREATE CONNECTION pg TO POSTGRES (
  11. HOST postgres,
  12. DATABASE postgres,
  13. USER postgres,
  14. PASSWORD SECRET pgpass
  15. )
  16. $ postgres-execute connection=postgres://postgres:postgres@postgres
  17. ALTER USER postgres WITH replication;
  18. DROP SCHEMA IF EXISTS public CASCADE;
  19. DROP PUBLICATION IF EXISTS mz_source;
  20. CREATE SCHEMA public;
  21. CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
  22. CREATE TABLE person (name TEXT, current_mood mood);
  23. INSERT INTO person VALUES ('Moe', 'happy');
  24. ALTER TABLE person REPLICA IDENTITY FULL;
  25. CREATE PUBLICATION mz_source FOR ALL TABLES;
  26. > CREATE SOURCE mz_source FROM POSTGRES CONNECTION pg (PUBLICATION 'mz_source');
  27. ! CREATE TABLE person FROM SOURCE mz_source (REFERENCE person);
  28. contains:referenced tables use unsupported types