public inbox for [email protected]  
help / color / mirror / Atom feed
DB wal file disabled --_Query
5+ messages / 3 participants
[nested] [flat]

* DB wal file disabled --_Query
@ 2024-11-13 16:15  jayakumar s <[email protected]>
  0 siblings, 2 replies; 5+ messages in thread

From: jayakumar s @ 2024-11-13 16:15 UTC (permalink / raw)
  To: pgsql-general

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)

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]$


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: DB wal file disabled --_Query
@ 2024-11-13 16:21  David G. Johnston <[email protected]>
  parent: jayakumar s <[email protected]>
  1 sibling, 0 replies; 5+ messages in thread

From: David G. Johnston @ 2024-11-13 16:21 UTC (permalink / raw)
  To: jayakumar s <[email protected]>; +Cc: pgsql-general

On Wed, Nov 13, 2024 at 9:16 AM jayakumar s <[email protected]>
wrote:

> postgres=# select name,setting from pg_settings where name like 'archive%';
>       name       |  setting
> -----------------+------------
>  archive_command | (disabled)
>

You cannot disable WAL.  What is disabled here is copying the WAL that is
produced to an archive.  IOW, backing up WAL.

David J.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: DB wal file disabled --_Query
@ 2024-11-13 16:24  Adrian Klaver <[email protected]>
  parent: jayakumar s <[email protected]>
  1 sibling, 1 reply; 5+ messages in thread

From: Adrian Klaver @ 2024-11-13 16:24 UTC (permalink / raw)
  To: jayakumar s <[email protected]>; pgsql-general

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]







^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: DB wal file disabled --_Query
@ 2024-11-14 09:14  jayakumar s <[email protected]>
  parent: Adrian Klaver <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: jayakumar s @ 2024-11-14 09:14 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; +Cc: pgsql-general

Hi All,

Archive mode is already disabled. If more wal files will generate fs also
reached 100 percent based on application data load.

As updated archive enabled or disabled. Will any state wall file that
will be generate correct?

On Wed, Nov 13, 2024 at 9:54 PM Adrian Klaver <[email protected]>
wrote:

> 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]
>
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: DB wal file disabled --_Query
@ 2024-11-14 14:02  David G. Johnston <[email protected]>
  parent: jayakumar s <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: David G. Johnston @ 2024-11-14 14:02 UTC (permalink / raw)
  To: jayakumar s <[email protected]>; +Cc: Adrian Klaver <[email protected]>; pgsql-general

On Thursday, November 14, 2024, jayakumar s <[email protected]>
wrote:

>
> Archive mode is already disabled. If more wal files will generate fs also
> reached 100 percent based on application data load.
>
> As updated archive enabled or disabled. Will any state wall file that
> will be generate correct?
>

WAL files are removed once they are no longer needed by the system.  If
they are not being removed you have an issue you need to debug to figure
out why they are staying around.

David J.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2024-11-14 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-13 16:15 DB wal file disabled --_Query jayakumar s <[email protected]>
2024-11-13 16:21 ` David G. Johnston <[email protected]>
2024-11-13 16:24 ` Adrian Klaver <[email protected]>
2024-11-14 09:14   ` jayakumar s <[email protected]>
2024-11-14 14:02     ` David G. Johnston <[email protected]>

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