CREATE SINK insights.account_to_account_groups_sink AS
SELECT
account_id,
account_group_id,
effective_start_date,
effective_end_date
FROM insights.account_to_account_groups_mv
WITH (
connector='postgres',
host='psql-nonprod-uae-derived.postgres.database.azure.com',
port='6432',
user='migration_user',
password='***',
database='adib-int-insights-db',
table='account_to_account_groups_dm',
schema='insights',
type='upsert',
force_compaction='true',
primary_key='account_id,account_group_id,effective_start_date'
)