Created
January 27, 2024 02:44
-
-
Save yai333/6410c41efb25dff75c15d1ed9a917466 to your computer and use it in GitHub Desktop.
init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create publication | |
CREATE PUBLICATION gcp_pub_cdc | |
FOR TABLE public.customers, public.orderdetails, | |
public.orders, public.products; | |
-- Create Publication slot | |
SELECT PG_CREATE_LOGICAL_REPLICATION_SLOT('gcp_pub_cdc_slot', 'pgoutput'); | |
-- Create db user for Datastream | |
CREATE USER sys_datastream WITH ENCRYPTED PASSWORD 'xxxxxx'; | |
-- Grant preivileges to the db user | |
GRANT RDS_REPLICATION TO sys_datastream; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO sys_datastream; | |
GRANT USAGE ON SCHEMA public TO sys_datastream; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public | |
GRANT SELECT ON TABLES TO sys_datastream; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment