diff --git a/ui/app/mirrors/create/handlers.ts b/ui/app/mirrors/create/handlers.ts
index 1d76c3196e..6b808fedbc 100644
--- a/ui/app/mirrors/create/handlers.ts
+++ b/ui/app/mirrors/create/handlers.ts
@@ -211,6 +211,17 @@ export const handleCreateQRep = async (
return;
}
+ if (
+ !xmin &&
+ config.writeMode?.writeType != QRepWriteType.QREP_WRITE_MODE_OVERWRITE &&
+ !(query.includes('{{.start}}') && query.includes('{{.end}}'))
+ ) {
+ notifyErr(
+ 'Please include placeholders {{.start}} and {{.end}} in the query'
+ );
+ return;
+ }
+
if (xmin == true) {
config.watermarkColumn = 'xmin';
config.query = `SELECT * FROM ${quotedWatermarkTable(
diff --git a/ui/app/mirrors/create/page.tsx b/ui/app/mirrors/create/page.tsx
index ed70c33b1e..2b0f59d33e 100644
--- a/ui/app/mirrors/create/page.tsx
+++ b/ui/app/mirrors/create/page.tsx
@@ -191,6 +191,11 @@ export default function CreateMirrors() {
Write a query whose results will be replicated to a target
table.
+ For append and upsert modes, make sure the query{' '}
+ includes the start and end placeholders in the query.
+ PeerDB uses these placeholders for partitioning query results
+ for performance.
+
In most cases, you will require a watermark table and a
watermark column in that table.