public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: jayakumar s <[email protected]>
To: [email protected]
Subject: Re: DB wal file disabled --_Query
Date: Wed, 13 Nov 2024 08:24:47 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFPcKG3hvKngtHg_Dy8_1Cq7zJhjcz_YRH-pfnSW4F1jeV5NNQ@mail.gmail.com>
References: <CAFPcKG3hvKngtHg_Dy8_1Cq7zJhjcz_YRH-pfnSW4F1jeV5NNQ@mail.gmail.com>

On 11/13/24 08:15, jayakumar s wrote:
> Hi Team,
> 
> We have disabled walfile ion database level. While I do manual switch 
> wal file generating in wal file location.
> 
> Here is my question if we disable it. Walfile won't generate am i correct?
> 
> Kindly clarify my doubts.
> 
> postgres=# select name,setting from pg_settings where name like 'archive%';
>        name       |  setting
> -----------------+------------
>   archive_command | (disabled)
>   archive_mode    | off
>   archive_timeout | 0
> (3 rows)

The above is disabling the archiving of WAL files to another location. 
WAL will still be written to pg_wal.

What are you trying to achieve?

You can  specify individual tables be UNLOGGED as shown here:

https://www.postgresql.org/docs/current/sql-createtable.html

"UNLOGGED

     If specified, the table is created as an unlogged table. Data 
written to unlogged tables is not written to the write-ahead log (see 
Chapter 28), which makes them considerably faster than ordinary tables. 
However, they are not crash-safe: an unlogged table is automatically 
truncated after a crash or unclean shutdown. The contents of an unlogged 
table are also not replicated to standby servers. Any indexes created on 
an unlogged table are automatically unlogged as well.

     If this is specified, any sequences created together with the 
unlogged table (for identity or serial columns) are also created as 
unlogged.
"




> 
> postgres=#
> 
> postgres=# SELECT pg_switch_wal();
>   pg_switch_wal
> ---------------
>   D/9D000000
> (1 row)
> 
> [postgres@xxxxxxxxx pg_wal]$ ls -lrt
> total 81920
> drwx------. 2 postgres postgres        6 Oct 13  2020 archive_status
> -rw-------. 1 postgres postgres 16777216 Nov 13 20:47 
> 000000010000000D0000009F
> -rw-------. 1 postgres postgres 16777216 Nov 13 20:50 
> 000000010000000D000000A0
> -rw-------. 1 postgres postgres 16777216 Nov 13 20:51 
> 000000010000000D000000A1
> -rw-------. 1 postgres postgres 16777216 Nov 13 21:02 
> 000000010000000D0000009D
> -rw-------. 1 postgres postgres 16777216 Nov 13 21:02 
> 000000010000000D0000009E
> [postgres@# pg_wal]$

-- 
Adrian Klaver
[email protected]







view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: DB wal file disabled --_Query
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox