-
Notifications
You must be signed in to change notification settings - Fork 15
Description
DOCUMENTATION ISSUE: Cross-Database Subscription Does Not Require Primary Key
Summary
The documentation states that the upstream object "must also have a primary key defined"
before creating a subscription for cross-database streaming. This is inaccurate — we
successfully created a subscription on a materialized view with no primary key and used
it for cross-database MV creation.
What the docs say
"The upstream object must also have a primary key defined."
The example reinforces this:
CREATE TABLE t1 (v1 INT PRIMARY KEY); -- Ensure PK exists
CREATE subscription sub_t1 FROM t1 WITH (retention = '1D');
Suggested doc changes
-
Describe the differences in RisingWave behavior between upstream pk and upstream without pk:
Change "The upstream object must also have a primary key defined."
To something like (verify for accuracy):
"If the upstream object has a primary key, the changelog will track changes
by key (insert, update, delete). Without a primary key, the changelog is
append-oriented — updates are represented as delete + insert of full rows.
A primary key is recommended for tables with frequent updates but is not
required." -
Update the example to show both cases — with PK and without — so users
understand the tradeoff rather than thinking it's a hard requirement. -
Clarify that subscriptions work on materialized views (not just tables).
The current example only shows CREATE TABLE. A user reading the docs might
assume subscriptions are table-only.