R
Railwayβ€’14mo ago
7wonders

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
Percy
Percyβ€’14mo ago
Project ID: N/A
7wonders
7wondersβ€’14mo ago
N/A
Solution
Brody
Brodyβ€’14mo ago
Brody
Brodyβ€’14mo ago
this contains a service that sets wal_level to logical in the accompanying postgres database
7wonders
7wondersβ€’14mo ago
Thx @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?
Brody
Brodyβ€’14mo ago
is that a valid flag?
7wonders
7wondersβ€’14mo ago
my bad, its "-c wal_level=logical" According to https://www.postgresql.org/docs/14/app-postgres.html#id-1.9.5.14.6.3 any runtime command config can be passed to postgres -c and wal_level is included https://www.postgresql.org/docs/14/runtime-config-wal.html
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 …
Brody
Brodyβ€’14mo ago
ah cool, you can override the containers start command in the service settings btw
7wonders
7wondersβ€’14mo ago
aha! But not with databases by the looks of things 😦 I guess a PGRUNTIME variable would come in handy then.
Brody
Brodyβ€’14mo ago
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
Brody
Brodyβ€’14mo ago
No description
7wonders
7wondersβ€’14mo ago
Nice! that makes life a bit easier πŸ™‚
Brody
Brodyβ€’14mo ago
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!
7wonders
7wondersβ€’14mo ago
Can you unmark solution and mark the better solution @Brody ?
Brody
Brodyβ€’14mo ago
i actually cant, its not possible as far as i know to change the marked solution
Want results from more Discord servers?
Add your server