Logical replication
I saw some talk back in June with one of the prisma gang regarding logical replication for pg databases. Is this possible and if so how would one enable
wal_level=logical
? I would love to be able to run a full https://electric-sql.com/docs/quickstart on railway πQuickstart - ElectricSQL
Let's dive in and start developing with ElectricSQL. First, we'll get the stack setup, then we'll show you the basics of using the system.
15 Replies
Project ID:
N/A
N/A
Solution
have a look at this
https://railway.app/template/pulse-pg
this contains a service that sets
wal_level
to logical
in the accompanying postgres databaseThx @Brody , much appreciated. Shame postgres doesnt have an env for setting that. I would like to suggest that railway add the functionality (optionally) for ease of use so
CMD ["postgres", "--port=5432"]
becomes CMD ["postgres", "wal_level=logical", "--port=5432"]
if a specific env is set?is that a valid flag?
my bad, its command config can be passed to postgres -c and wal_level is included https://www.postgresql.org/docs/14/runtime-config-wal.html
"-c wal_level=logical"
According to https://www.postgresql.org/docs/14/app-postgres.html#id-1.9.5.14.6.3 any runtime PostgreSQL Documentation
20.5.Β Write Ahead Log
20.5.Β Write Ahead Log 20.5.1. Settings 20.5.2. Checkpoints 20.5.3. Archiving 20.5.4. Archive Recovery 20.5.5. Recovery Target For additional information on tuning β¦
PostgreSQL Documentation
postgres
postgres postgres β PostgreSQL database server Synopsis postgres [option...] Description postgres is the PostgreSQL database server. In order for a β¦
ah cool, you can override the containers start command in the service settings btw
aha!
But not with databases by the looks of things π¦ I guess a PGRUNTIME variable would come in handy then.
oh, you arent on beta
when on beta, databases are just services, a docker image, and a volume
super versatile
(type /beta to join)
docker-entrypoint.sh postgres -c wal_level=logical --port=5432
Nice!
that makes life a bit easier π
yeah this is way better
@Melissa now that databases are just services, this start command can replace the
Restart-Db-Then-Delete-Me
service and accompanying template!Can you unmark solution and mark the better solution @Brody ?
i actually cant, its not possible as far as i know to change the marked solution