wal_dump output on CREATE DATABASE

From: Jean-Christophe Arnu <jcarnu(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: wal_dump output on CREATE DATABASE
Date: 2018-10-26 13:53:01
Message-ID: CAHZmTm18Ln62KW-G8NYvO1wbBL3QU1E76Zep=DuHmg-zS2XFAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear hackers,

This is my first try to post on that list to propose a workaround on an
issue I noticed while using pg_waldump. Each time an object is referenced
by "oids" following output template :
tablespace oid/database oid/relfilenodeid

That template seems to be used for each operation but the *copy dir*
operation. The latter is performed (at least) when CREATE DATABASE
statement is called with the template: oid/tablespace oid

Exemple on CREATE DATABASE (without defining a template database) :
rmgr: Database len (rec/tot): 42/ 42, tx: 568, lsn:
0/01865790, prev 0/01865720, desc: CREATE copy dir 1/1663 to 16384/1663

It comes out (to me) it may be more consistent to use the same template
than the other operations in pg_waldump.
I propose to swap the parameters positions for the copy dir operation
output.

You'll find a patch file included which does the switching job :
rmgr: Database len (rec/tot): 42/ 42, tx: 568, lsn:
0/01865790, prev 0/01865720, desc: CREATE copy dir 1663/1 to 1663/16384

- Project name ; PostgreSQL
- File : copy_dir_message_switch_parameters_v0.patch
- Description : Swaps copy dir output parameters
- This patch is not WIP (but may be discussed)
- Patch applied against master branch
- Compiles and tests successfully
- No platform specific code
- No need of regression test
- Not a new feature
- No performance impact

Any comment or advice are more than welcome.

If I didn't do the things the right way, I would appreciate some help from
a kind mentor.

I'll put the patch for the next commitfest.

Thank you,
--
Jean-Christophe Arnu

Attachment Content-Type Size
copy_dir_message_switch_parameters_v0.patch text/x-patch 844 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-10-26 13:54:51 fix psql \conninfo & \connect when using hostaddr
Previous Message Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?= 2018-10-26 13:40:29 Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER