Recommended Free Tools
To set up PostgreSQL logical replication between two VPS servers, configure one database as the publisher and the other as the subscriber, allow a dedicated replication login through the network, create a publication on the publisher, and create a subscription on the subscriber. PostgreSQL copies the existing rows first, then streams later changes in transaction order.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The setup is selective rather than a full server clone: you choose databases, tables and, where needed, the data-change operations to publish. DDL, sequence values and large objects require separate procedures.
As an Amazon Associate I earn from qualifying purchases.
What logical replication does
Logical replication uses a publisher/subscriber model. A publication is a set of tables and data-change operations exposed by the publisher. A subscription connects to that publication and pulls changes into tables that already exist on the subscriber.
When a subscription is created, PostgreSQL normally performs an initial table-data copy. After that copy completes, the subscriber applies incremental changes. Changes delivered through one subscription are applied in publisher order, preserving transactional consistency for that subscription.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Both servers are ordinary PostgreSQL installations. They can run on different major PostgreSQL versions and different operating systems, although the table definitions, data types and operational procedures still need to be compatible. A subscriber can also publish its own data, which enables cascading arrangements.
What it does not replicate
- Database schema changes and DDL commands.
- Sequence state.
- Large objects.
- Local writes made on the subscriber unless that database is separately configured as a publisher.
Plan schema deployment, sequence management and large-object handling alongside replication rather than assuming they will follow the row changes.
Choose the topology and scope first
Write down the publisher VPS, subscriber VPS, database name, table list and intended direction before changing configuration. Confirm that the subscriber can reach the publisher’s PostgreSQL TCP port and decide whether the subscriber is a read-only copy, a migration target or part of a cascading design.
| Design | Typical scope | Decisions to make |
|---|---|---|
| One-way read copy | Selected or broad table set | Keep subscriber writes separate; plan failover and sequence handling. |
| Selective table replication | Named tables and chosen DML operations | Confirm every required table, key and dependency is included. |
| Cross-version migration | Data moved between supported major versions | Check type compatibility, initial-copy duration and cutover procedure. |
| Cascading replication | Publisher to subscriber, then onward | Give each hop enough slots, workers, WAL and monitoring. |
Estimate the initial-copy size, the time available for catch-up, expected write volume, network capacity and disk space for retained WAL. There is no universal VPS size or lag target: derive those from your workload and storage headroom.
Decide exactly what is published
Include only the tables and change types the subscriber needs. Publishing fewer tables reduces initial-copy work and limits the data exposed over the replication connection. If a downstream system only needs inserts, do not assume it should receive updates and deletes as well. Conversely, omitting a table that is required to satisfy a foreign key or application query can make the subscriber unusable.
Publications are database-local. If several databases on the publisher need to be copied, treat each database as a separate design with its own publication and subscription work. Record table ownership, grants and schema dependencies so a later table addition does not silently fail its initial copy.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsPublisher prerequisites and configuration
Set the required WAL and sender capacity
Edit postgresql.conf on the publisher:
wal_level = logical
max_replication_slots = <subscriptions plus synchronization reserve>
max_wal_senders = <at least max_replication_slots plus physical replicas>
wal_level = logical enables the information needed to decode row changes. Reserve a replication slot for each expected subscription and additional capacity for table synchronization. Set max_wal_senders to at least the slot count plus any physical-replica senders you operate.
Some settings require a PostgreSQL restart. After restarting, connect to the publisher database and verify the effective values:
SHOW wal_level;
SHOW max_replication_slots;
SHOW max_wal_senders;
Do not size slots only for today’s subscriptions. A new subscription or a temporary synchronization worker can consume capacity, and an undersized value prevents the design from starting.
Understand the WAL-retention consequence
A logical replication slot records how far a subscriber has consumed changes. If the subscriber is disconnected or its apply worker is blocked, the publisher must retain WAL needed by that slot. That retention can consume disk even when the primary database itself appears healthy. Include a credible period of subscriber downtime when sizing storage, and monitor both slot retention and free space.
Create a dedicated replication login
Use a role reserved for replication rather than an administrator account:
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
CREATE ROLE repuser WITH LOGIN REPLICATION PASSWORD 'use-a-secret-manager';
The role needs LOGIN so the subscriber can connect and REPLICATION so it can use the logical replication protocol. Grant SELECT on every table included in the initial copy:
GRANT SELECT ON TABLE public.users, public.departments TO repuser;
Add a grant whenever a table is added to the publication. Protect the password in your deployment’s secret manager; do not place a real credential in shell history, source control or documentation.
Allow only the intended subscriber to connect
Configure pg_hba.conf
Add a narrowly scoped host rule on the publisher. The following shows the required shape:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
host all repuser <subscriber-cidr> scram-sha-256
Replace <subscriber-cidr> with the subscriber’s actual address or subnet. Do not leave a broad example network in production. Keep the rule tied to the dedicated role and use the strongest authentication method supported by both servers.
Reload PostgreSQL after editing pg_hba.conf. Also configure the VPS provider’s firewall or security group so the PostgreSQL port accepts traffic only from the subscriber’s address range. A correct database rule cannot compensate for an internet-wide firewall opening.
Use encrypted transport
Where TLS is enabled in your deployment, require it in the subscription connection string with sslmode=require. Verify certificate and trust settings according to your PostgreSQL installation; encryption protects credentials and row changes while they cross the VPS network.
Prepare the subscriber VPS
Create matching target tables
Create the target database and tables before creating the subscription. The subscriber’s table columns, data types and relevant constraints must accept the rows sent by the publisher. Logical replication does not create a schema for you and does not apply later DDL.
Coordinate schema changes explicitly: deploy compatible table changes on both sides, then alter the publication or subscription as required. For a migration, keep a written cutover plan for writes that occur while the initial copy is running.
Reserve slots and workers
Set subscriber capacity in postgresql.conf:
max_replication_slots = <subscriptions plus synchronization reserve>
max_logical_replication_workers = <subscriptions plus sync/parallel reserve>
max_worker_processes = <enough for logical workers plus other workers>
The subscriber uses replication slots for subscriptions and synchronization, logical replication workers for apply and table synchronization, and general background workers for the overall server. Include existing extensions and workloads when choosing max_worker_processes. Restart if the changed parameters require it, then verify the effective settings with SHOW commands.
Reserve capacity for every subscription, table synchronization workers and any parallel apply work, not only the steady-state apply process. A busy VPS may also need workers for extensions and other background tasks. If the total worker budget is too small, synchronization or apply can be delayed even though the network connection is healthy.
If this VPS might become a failover target, separately document sequence values, large objects and any schema objects that logical replication will not carry.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Check replica identity before publishing updates or deletes
PostgreSQL needs a way to identify the affected row when it sends an UPDATE or DELETE. A primary key is the normal choice. Confirm that each published table receiving those operations has a suitable identity on the publisher and a compatible table on the subscriber.
If no practical key exists, you can use a full-row identity:
ALTER TABLE public.events REPLICA IDENTITY FULL;
REPLICA IDENTITY FULL is a fallback, not a free substitute for a key. The subscriber may need to search using the old values of the entire row, which can be inefficient on large tables. Tables that receive only inserts do not need identity for those inserts, but review the publication before later enabling updates or deletes.
Create the publication on the publisher
Connect to the publisher database and create a publication containing the tables you selected:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCREATE PUBLICATION mypub FOR TABLE users, departments;
A publication is local to one database. You can create multiple publications and multiple subscribers, and you can add tables or limit the published data-change operations later with ALTER PUBLICATION. Keep the table list explicit so an unrelated table is not exposed accidentally.
Before proceeding, verify that the replication role can select every published table and that the subscriber schema is ready for the initial copy. When changing the publication later, repeat this check: a newly added table needs a compatible subscriber table and the replication role must be able to read it.
Create the subscription on the subscriber
Run this command in the subscriber database:
CREATE SUBSCRIPTION mysub
CONNECTION 'dbname=foo host=publisher.example user=repuser password=REDACTED sslmode=require'
PUBLICATION mypub;
Use the publisher’s reachable hostname or address and keep the real password in a secret-management mechanism. Creating the subscription normally creates or uses a replication slot, starts copying existing rows and then begins applying ongoing changes.
The initial copy can take substantial time. Avoid treating a partially copied table as complete, and schedule the operation with enough publisher WAL and subscriber disk space to cover the catch-up period. Keep application cutover separate from subscription creation: first prove that the target has caught up, then redirect reads or writes according to the migration plan.
Plan an initial-copy cutover
During the initial copy, the publisher continues accepting changes. The subscriber therefore needs enough network, worker and storage capacity to copy existing rows while it catches up with new changes. Decide in advance how you will verify completeness, which application writes must be paused for a final cutover, and how you will handle sequences and schema objects that are outside logical replication.
Validate that replication is actually working
Inspect the subscriber worker
On the subscriber, query the subscription statistics view:
SELECT * FROM pg_stat_subscription;
An enabled subscription normally has an apply worker. During the initial copy or parallel apply, additional workers can appear for table synchronization. A missing worker, a repeatedly changing process state or a subscription that is disabled warrants immediate log review.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Review conflicts and errors
Use the conflict statistics view when available:
SELECT * FROM pg_stat_subscription_stats;
Read the PostgreSQL server log on the subscriber for authentication failures, missing tables, permission errors, duplicate keys and other apply failures. The view and logs together show whether a worker stopped because of data, schema or permission problems.
Watch slots and WAL on the publisher
Inspect publisher slots:
SELECT * FROM pg_replication_slots;
An inactive subscription can keep WAL retained through its slot. Monitor slot activity, retained WAL and free disk space. Alert on a missing apply worker, repeated connection failures, growing slot retention and sustained apply delay. Choose alert limits from the workload and storage capacity rather than copying a universal number.
Verify data and scope
Check representative row counts and application queries on the subscriber after the initial copy. Confirm that every intended table is present and that tables deliberately excluded from the publication are not expected to change there. A connected worker alone does not prove that schema, permissions, replica identity or business-level consistency are correct.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Resolve common failures safely
Authentication or connection failure
- Confirm the publisher is listening on the expected address and port.
- Check the VPS firewall and security-group source range.
- Verify the
pg_hba.confaddress, role name and authentication method. - Confirm that the subscription connection string uses the correct database, host, user and TLS setting.
- Reload PostgreSQL after an
pg_hba.confchange and inspect the server log for the rejected connection.
Initial copy fails on permissions
Check that repuser still has SELECT on every published table. A table added after the role grants were created needs its own grant. Also confirm that the target table exists on the subscriber with compatible columns and constraints.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →An update or delete cannot be applied
Check the table’s primary key or replica identity on the publisher and the corresponding target table. If there is no practical key, decide whether the performance cost of REPLICA IDENTITY FULL is acceptable before enabling the operation.
A conflict stops the apply worker
Subscriber-local writes can collide with incoming changes. Constraint and permission conflicts can stop replication. Read the log and conflict statistics, identify the row or permission causing the failure, correct the data or privileges, and then resume the subscription. Skipping a transaction is an advanced recovery action: it can leave the subscriber inconsistent unless you reconcile the omitted change afterward.
WAL retention grows unexpectedly
Find the inactive or lagging slot in pg_replication_slots, then determine whether the subscriber is disconnected, blocked by a conflict or unable to apply changes. Do not simply drop a slot to hide the alert: dropping it removes the server’s retention point and may require rebuilding the subscription or resynchronizing data.
Operate logical replication over time
- Track the enabled state and worker presence in
pg_stat_subscription. - Review
pg_stat_subscription_statsand PostgreSQL logs for conflicts and apply errors. - Monitor slot retention and publisher disk usage.
- Test firewall, DNS, credential rotation and certificate changes before they affect production.
- Keep schema migrations synchronized because DDL is not replicated.
- Document sequence and large-object procedures for migrations and failover.
- Back up both databases; replication is not a substitute for point-in-time recovery.
Revisit capacity after adding subscriptions, publications or physical replicas. Slot and sender relationships that worked for one subscriber may be insufficient for a cascading or mixed logical-and-physical design. Keep an inventory of slots, their owners and their expected consumers so an abandoned subscription does not retain WAL indefinitely.
Where a VPS fits
A self-managed VPS is appropriate when you need control over PostgreSQL versions, configuration files, firewall rules and private networking. Before choosing an instance, confirm that you have administrative access, enough disk for database files and retained WAL, backup capability, encrypted connections and permission to change the PostgreSQL settings listed above.
Private networking reduces exposure between publisher and subscriber, but it does not remove the need for pg_hba.conf restrictions or database authentication. Size storage for normal data plus the worst credible period of subscriber downtime; a replication slot can retain WAL until the subscriber catches up or is rebuilt.
When comparing managed or self-managed VPS options, check PostgreSQL version control, root or administrative access, private-network availability, firewall and security-group controls, encrypted connections, backup facilities, disk and WAL capacity, and whether you can change the required settings. The cheapest instance is unsuitable if it cannot provide those controls or enough storage headroom.
Best Value
Preflight checklist
- Publisher and subscriber hosts can reach each other on the PostgreSQL port.
- The selected database and table scope are documented.
wal_levelislogicalon the publisher.- Publisher slots and WAL senders include subscriptions, synchronization and any physical replicas.
- Subscriber slots, logical workers and total worker processes include synchronization and existing workloads.
- A dedicated role has
LOGIN,REPLICATIONand tableSELECTprivileges. - The firewall and
pg_hba.confallow only the intended subscriber range. - The subscription uses protected credentials and encrypted transport where supported.
- Target tables exist before subscription creation.
- Tables receiving updates or deletes have a suitable replica identity.
- Monitoring covers workers, conflicts, connection failures, apply delay, slot retention and disk space.
- Separate procedures exist for DDL, sequences, large objects, backups and failover.
Frequently Asked Questions
Can logical replication run between different PostgreSQL versions?
Yes. PostgreSQL logical replication can bridge different major versions and operating systems, but review table definitions, data types and operational compatibility before starting a migration.
Does creating a subscription copy existing rows?
Normally, yes. Subscription creation starts an initial copy of published table data and then applies ongoing changes. Plan disk, network, worker and WAL capacity for the copy and catch-up period.
Why does the replication role need SELECT privileges?
The role needs SELECT on every published table so PostgreSQL can perform the initial table-data copy. Grant access again when adding a table to an existing publication.
Do I need a primary key on every replicated table?
A primary key is the normal replica identity for tables receiving UPDATE or DELETE. Without a practical key, REPLICA IDENTITY FULL can be used, but searching by the old values of the entire row may be inefficient. Insert-only tables do not need identity for inserts.
Will schema changes and sequences replicate automatically?
No. DDL, schema changes, sequence state and large objects require separate deployment and synchronization procedures.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →What should I do if the subscription stops?
Check pg_stat_subscription, pg_stat_subscription_stats and the subscriber’s PostgreSQL log. Look for authentication, missing-table, permission, duplicate-key and other conflict errors. Correct the underlying data or configuration, then resume the subscription.
Is it safe to drop a replication slot when WAL retention is high?
Not as a first response. Dropping the slot removes the retention point and may force a subscription rebuild or data resynchronization. First identify whether the subscriber is disconnected, blocked or unable to apply changes.
Can I write locally to the subscriber?
Local writes can conflict with incoming changes and stop the apply worker. If the subscriber must publish onward or accept writes, design that topology deliberately and define conflict and reconciliation procedures.
How much VPS storage or replication lag should I plan for?
There is no universal size or lag target. Derive requirements from data volume, write rate, initial-copy duration, network capacity, expected downtime and the amount of WAL your storage can retain.
The Bottom Line
Logical replication on a VPS is a controlled sequence: size publisher and subscriber capacity, secure a dedicated login, prepare matching tables and replica identities, create the publication and subscription, then monitor workers, conflicts, slots and WAL. Treat DDL, sequences, large objects, backups and failover as separate operational work, and never let an inactive subscription retain WAL unnoticed.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




