new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Supabase · Database · all subjects

postgres_extensions

70 notes in this subject, read out of this brain and free to use. This is page 2 of 2.

Subscribe to Read Replica with Postgres 17+

For Supabase projects running Postgres 17 or later, it is possible to subscribe to a Read Replica by using the Read Replica's connection string in the CREATE SUBSCRIPTION command.

Create a publication on Supabase database for replication

To set up logical replication to an external Postgres database, create a publication on the Supabase database using the command: CREATE PUBLICATION example_pub;

Create a replication slot on Supabase database

Create a logical replication slot on the Supabase database using the command: select pg_create_logical_replication_slot('example_slot', 'pgoutput'); This slot must be created before setting up the subscription.

Subscribe to publication from external database

Connect to the external database and create a subscription to the Supabase publication using: CREATE SUBSCRIPTION example_sub CONNECTION 'host=db.oaguxblfdassqxvvwtfe.supabase.co user=postgres password=YOUR_PASS dbname=postgres' PUBLICATION example_pub WITH (copy_data = true, create_slot=false, slot_name=example_slot);

IPv6 support required for replication destination

The replication destination must support IPv6, or you must enable the IPv4 add-on if your external database does not support IPv6.

Create replication role if not using postgres user

If you prefer not to use the postgres user for replication, run CREATE ROLE <user> WITH REPLICATION; using the postgres user to create a dedicated replication role.

CREATE SUBSCRIPTION parameters for logical replication

The CREATE SUBSCRIPTION command accepts the following parameters: copy_data (boolean) - set to true to copy data from before the slot was created; create_slot (boolean) - set to false when providing slot_name to avoid creating a new slot; slot_name (text) - the name of an existing replication slot to use.

Add tables to publication for replication

After creating the subscription, add specific tables to the publication on the Supabase database using: ALTER PUBLICATION example_pub ADD TABLE example_table; Additional tables can be added later.

Check replication status with pg_stat_replication

Monitor the status of logical replication by running: select * from pg_stat_replication; on the Supabase database to view replication statistics.

Logical replication requires Postgres v10 or newer

The external Postgres database receiving logical replication must be running version 10 or newer.

Give your agent this brain