Questions tagged [wal]

WAL, or write-ahead log, is a form of journalling used as part of crash-safety and atomic commit support in databases like PostgreSQL and SQLite.

PostgreSQL's write-ahead log is a crucial feature that permits crash-safety and atomic commit to be implemented. It's also heavily used in PostgreSQL's point-in-time recovery, streaming replication, and archive based replication features, as well as hot physical backup.

In SQLite, the default method by which SQLite implements atomic commit and rollback is a rollback journal. Beginning with version 3.7.0, a new "Write-Ahead Log" option (hereafter referred to as "WAL") is available.

229 questions
32
votes
4 answers

How to merge contents of SQLite 3.7 WAL file into main database file

With WAL (Write-Ahead-Logging) enabled in SQLite 3.7 (which is the default for Core Data on iOS 7), how do I merge/commit the content from the -wal file back into the main database file?
Johannes Fahrenkrug
  • 42,912
  • 19
  • 126
  • 165
25
votes
6 answers

Is it safe to delete sqlite's WAL file?

I have a strange problem with Core Data in an iOS app where sometimes the WAL file becomes huge (~1GB). It appears there are other people with the problem (e.g. Core Data sqlite-wal file gets MASSIVE (>7GB) when inserting ~5000 rows). My initial…
mattjgalloway
  • 34,792
  • 12
  • 100
  • 110
16
votes
4 answers

How to open SQLite connection in WAL mode

In C#, how to open an SQLite connection in WAL mode? Here is how I open in normal mode: SQLiteConnection connection = new SQLiteConnection("Data Source=" + file); connection.Open(); // (Perform my query)
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
11
votes
3 answers

How to disable WAL journal mode

https://developer.apple.com/library/ios/releasenotes/DataManagement/WhatsNew_CoreData_iOS/ I am having trouble in disabling journal mode. My code is: static NSManagedObjectContext *managedObjectContext(){ static NSManagedObjectContext *context =…
user2512523
  • 1,229
  • 2
  • 15
  • 25
10
votes
3 answers

Changing "wal_level" on PostgreSQL 13 (via client session) is not being respected

On a running PostgreSQL 13 instance, I tried modifying it's wal_level system setting as follows, but it's not being respected: postgres@localhost:postgres> SHOW wal_level +-------------+ | wal_level | |-------------| | replica …
NYCeyes
  • 5,215
  • 6
  • 57
  • 64
10
votes
5 answers

Which Postgresql WAL files can I safely remove from the WAL archive folder

Current situation So I have WAL archiving set up to an independent internal harddrive on a data logging computer running Postgres. The harddrive containing the WAL archives is filling up and I'd like to remove and archive all the WAL archive files,…
undercurrent
  • 285
  • 1
  • 2
  • 12
9
votes
5 answers

Disabling sqlite Write-Ahead logging in Android Pie

In Android Pie sqlite Write-Ahead logging (WAL) has been enabled by default. This is causing errors for my existing code only in Pie devices. I have been unable to turn off WAL successfully using SQLiteDatabase.disableWriteAheadLogging() or PRAGMA…
Rockvole
  • 4,422
  • 3
  • 21
  • 27
9
votes
1 answer

SQLITE database WAL file size keeps growing

I am writing continuously into a db file which has PRAGMA journal_mode=WAL, PRAGMA journal_size_limit=0. My C++ program has two threads, one reader(queries at 15 sec intervals) and one writer(inserts at 5 sec intervals). Every 3 min I am pausing…
Obli07vion
  • 93
  • 1
  • 3
7
votes
1 answer

disable wal replay on crash for prometheus

Is there a way to disable WAL replay on crash for Prometheus? It takes a while for a pod to come back up due to WAL replay: We can afford to lose some metrics if it meant faster recovery after the crash. level=info ts=2021-04-22T20:13:42.568Z…
Steve
  • 863
  • 3
  • 9
  • 21
6
votes
2 answers

How to specify cleanup by file age or date with pg_archivecleanup

Is there a way to specify files by age or date instead of by a hardcoded name to cleanup the WAL archives with the pg_archivecleanup command ? For example, using the following command is pretty straightforward: pg_archivecleanup "C:\Program…
Sébastien Clément
  • 570
  • 1
  • 9
  • 19
5
votes
0 answers

Movement of restart_lsn position movement of logical replication slots is very slow

We have two logical replication slots in our postgresql database (version-11) instance and we are using pgJDBC to stream data from these two slots. We are ensuring that when we regularly send feedback and update the confirmed_flush_lsn (every 10…
5
votes
1 answer

PostgreSQL replication - how to update LSN after reading with pg_recvlogical and wal2json? (without superuser)

I am trying to implement a regular incremental changes dump for our PostgreSQL 9.5 database. I have opted for WAL, the wal2json plugin and pg_recvlogical. All works somehow, except for one thing: When all data are read, pg_recvlogical simply goes…
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
5
votes
1 answer

How to enable auto clean of pg_xlog

I'm trying to configure a PostgreSQL 9.6 database to limit the size of the pg_xlog folder. I've read a lot of threads about this issue or similar ones but nothing I've tried helped. I wrote an setup script for my Postgresql 9.6 service instance. It…
Ggilmann
  • 55
  • 1
  • 5
5
votes
4 answers

How to parse postgresql wal log file to sql

The PostgreSQL database server stores "change data" in WAL log file, and I wanted to parse the archive log file to sql like mysqlbinlog parse binlog file to sql, That I can find the application execute sql. Does anyone have a tool like this?
user3007747
  • 83
  • 1
  • 5
5
votes
1 answer

Creating SQLite database with Exclusive lock in C#

I'm trying to create a database with journal mode set to WAL and disable shared memory by setting locking mode to EXCLUSIVE but I can't seem to make it work. My connection string looks like this: _connectionString = string.Format("Data…
Erik Karlstrand
  • 1,479
  • 9
  • 22
1
2 3
15 16