@@ -394,20 +394,6 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
394
394
395
395
PG_TRY ();
396
396
{
397
- /*
398
- * If requested, create permanent slot for the subscription.
399
- * We won't use the initial snapshot for anything, so no need
400
- * to export it.
401
- */
402
- if (create_slot )
403
- {
404
- walrcv_create_slot (wrconn ,slotname , false,
405
- CRS_NOEXPORT_SNAPSHOT ,& lsn );
406
- ereport (NOTICE ,
407
- (errmsg ("created replication slot \"%s\" on publisher" ,
408
- slotname )));
409
- }
410
-
411
397
/*
412
398
* Set sync state based on if we were asked to do data copy or
413
399
* not.
@@ -432,6 +418,20 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
432
418
433
419
ereport (NOTICE ,
434
420
(errmsg ("synchronized table states" )));
421
+
422
+ /*
423
+ * If requested, create permanent slot for the subscription.
424
+ * We won't use the initial snapshot for anything, so no need
425
+ * to export it.
426
+ */
427
+ if (create_slot )
428
+ {
429
+ walrcv_create_slot (wrconn ,slotname , false,
430
+ CRS_NOEXPORT_SNAPSHOT ,& lsn );
431
+ ereport (NOTICE ,
432
+ (errmsg ("created replication slot \"%s\" on publisher" ,
433
+ slotname )));
434
+ }
435
435
}
436
436
PG_CATCH ();
437
437
{