Re: postgres wal log configuration question - Mailing list pgsql-admin

From Pavan Kumar
Subject Re: postgres wal log configuration question
Date
Msg-id CA+M0sHHAAgNh-n5BQcX8eYj-miVBPoXt7D-RK_3FT=sZrHNPyQ@mail.gmail.com
Whole thread Raw
In response to postgres wal log configuration question  (Pavan Kumar <pavan.dba27@gmail.com>)
Responses Re: postgres wal log configuration question  (Rui DeSousa <rui@crazybean.net>)
List pgsql-admin
Hello Experts,

Kindly provide feedback on my questions.

Thank you.


On Mon, May 6, 2019 at 2:25 PM Pavan Kumar <pavan.dba27@gmail.com> wrote:
postgres wal log configuration question

hello experts,

I have couple of question on postgres wal log configuration.

how do we know current wal log location  and current wal segment name in postgres ? is there any query to to check location ?


I ran the switch wal log command, as below 

postgres=# select pg_switch_wal();
 pg_switch_wal
---------------
 C/E000158
(1 row)

how do i understand the output ? Is this  wal segment name ? If yes, when i look at wal log location i do see below output. how do i correlate query output with os command output ?

postgres=# select pg_switch_wal();
 pg_switch_wal
---------------
 C/E000158
(1 row)

postgres=# \! ls -lart /oradbaudit/pg_data_dir/pg_wal|tail -5  >>>> last wal segments generated on wal location. 
lrwxrwxrwx. 1 postgres postgres 23 May  6 16:06 /oradbaudit/pg_data_dir/pg_wal -> /oradbaudit/pg_wal_dir/
postgres=# \! ls -lart /oradbaudit/pg_data_dir/pg_wal/|tail -5
-rw-------.  1 postgres postgres 16777216 May  6 17:37 000000020000000C00000048
drwx------.  3 postgres postgres    12288 May  6 17:41 .
-rw-------.  1 postgres postgres 16777216 May  6 18:57 000000020000000C0000000E
drwx------.  2 postgres postgres      125 May  6 18:57 archive_status
-rw-------.  1 postgres postgres 16777216 May  6 18:57 000000020000000C0000000F

Is there any way to provide meaning full sequence number for wal segments? looks like wal segment file name is generating random names. is there any way to control name format ?

I noticed that file wal file name generated on $PGDATA/pg_wal location and archived location seem different. is this expected behavior ?


please help me to understand this concept.


--
Regards,

#!  Pavan Kumar
----------------------------------------------
-
Sr. Database Administrator..!

NEXT GENERATION PROFESSIONALS, LLC
Cell    #  267-799-3182 #  pavan.dba27 (Gtalk)  
India   # 9000459083

Take Risks; if you win, you will be very happy. If you lose you will be Wise  


--
Regards,

#!  Pavan Kumar
----------------------------------------------
-
Sr. Database Administrator..!

NEXT GENERATION PROFESSIONALS, LLC
Cell    #  267-799-3182 #  pavan.dba27 (Gtalk)  
India   # 9000459083

Take Risks; if you win, you will be very happy. If you lose you will be Wise  

pgsql-admin by date:

Previous
From: Siddharth Karandikar
Date:
Subject: Re: Restoring from PostgreSQL 9.5 dump to 10 is super slow
Next
From: SAMMY CRISWELL
Date:
Subject: Upgrade from psql version 9.3 to 9.6.