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.

169 questions
26
votes
3 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
  • 38,500
  • 17
  • 113
  • 155
14
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
  • 55,003
  • 52
  • 197
  • 338
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
  • 989
  • 2
  • 11
  • 23
10
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
  • 2,806
  • 3
  • 15
  • 27
8
votes
4 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
  • 265
  • 1
  • 2
  • 10
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
2 answers

ios7 sqlite database with WAL never syncs the main database file

I've read many threads about the new WAL default setting in ios7 SQLite / Core Data stack. It looked like a good idea in the first place... Though I need to perform a database copy to a distant webservice from time to time according to my business…
vivien.destpern
  • 950
  • 1
  • 6
  • 14
5
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
  • 480
  • 1
  • 7
  • 18
4
votes
1 answer

How does write ahead logging improve IO performance in Postgres?

I've been reading through the WAL chapter of the Postgres manual and was confused by a portion of the chapter: Using WAL results in a significantly reduced number of disk writes, because only the log file needs to be flushed to disk to guarantee…
RangerRanger
  • 2,129
  • 2
  • 12
  • 31
4
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
  • 45
  • 1
  • 5
4
votes
1 answer

SQLITE 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
  • 43
  • 1
  • 3
4
votes
1 answer

Disabling WAL archiving during pg_restore?

Let's say I made a quick backup dump of my Postgres 9.3 DB through pg_dump before doing a large destructive migration and I discovered I want to undo it. No writes were performed against the DB in the meantime. Say I run pg_restore -c -d mydb <…
Alexandr Kurilin
  • 7,188
  • 6
  • 43
  • 72
4
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,360
  • 7
  • 19
3
votes
0 answers

How to build and install wal2json without also installing the package postgresql-server-dev on Debian 9?

I'm trying to stream data automatically from PostgreSQL 10 to Kafka using debezium together with the logical decoding plugin, wal2json. I followed all the instructions on how to build and install the plugin from this link by running these command…
Prince Vegeta
  • 701
  • 4
  • 21
3
votes
2 answers

Is log sequence number really monotonic in postgres?

When reading at postgreSQL documentation: WAL records are appended to the WAL logs as each new record is written. The insert position is described by a Log Sequence Number (LSN) that is a byte offset into the logs, increasing monotonically with…
Artholl
  • 83
  • 12
1
2 3
11 12