create-in-v0.27.0-pg-cdc.td 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. DROP PUBLICATION IF EXISTS upgrade_pg_cdc_publication_v_0_27_0;
  11. DROP TABLE IF EXISTS upgrade_pg_cdc_table;
  12. CREATE TABLE upgrade_pg_cdc_table (f1 INTEGER);
  13. ALTER TABLE upgrade_pg_cdc_table REPLICA IDENTITY FULL;
  14. INSERT INTO upgrade_pg_cdc_table VALUES (1),(2),(3),(4),(5);
  15. CREATE PUBLICATION upgrade_pg_cdc_publication_v_0_27_0 FOR TABLE upgrade_pg_cdc_table;
  16. > CREATE SECRET IF NOT EXISTS pgpass AS 'postgres';
  17. > CREATE CONNECTION IF NOT EXISTS pgconn FOR POSTGRES
  18. HOST postgres,
  19. USER postgres,
  20. PASSWORD SECRET pgpass,
  21. DATABASE postgres;
  22. > CREATE SOURCE upgrade_pg_cdc_source
  23. FROM POSTGRES
  24. CONNECTION pgconn
  25. (PUBLICATION 'upgrade_pg_cdc_publication_v_0_27_0')
  26. FOR TABLES (
  27. upgrade_pg_cdc_table AS upgrade_pg_cdc_table_v_0_27_0
  28. );
  29. > SELECT * FROM upgrade_pg_cdc_table_v_0_27_0;
  30. 1
  31. 2
  32. 3
  33. 4
  34. 5