01-configure-postgres.td 1.1 KB

123456789101112131415161718192021222324252627
  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-execute connection=postgres://postgres:postgres@postgres
  10. CREATE USER debezium WITH SUPERUSER PASSWORD 'debezium';
  11. GRANT ALL PRIVILEGES ON DATABASE "postgres" TO debezium;
  12. GRANT ALL PRIVILEGES ON SCHEMA "public" TO debezium;
  13. CREATE PUBLICATION mz_source FOR ALL TABLES;
  14. $ postgres-execute connection=postgres://postgres:postgres@postgres
  15. DROP TABLE IF EXISTS ten;
  16. CREATE TABLE ten (f1 INTEGER);
  17. ALTER TABLE ten REPLICA IDENTITY FULL;
  18. INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
  19. DROP TABLE IF EXISTS t1;
  20. CREATE TABLE t1 (f1 INTEGER, f2 TEXT);
  21. ALTER TABLE t1 REPLICA IDENTITY FULL;
  22. INSERT INTO t1 SELECT a1.f1 + a6.f1 , E'abc\nxyz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;