wal_dump output on CREATE DATABASE - Mailing list pgsql-hackers

From Jean-Christophe Arnu
Subject wal_dump output on CREATE DATABASE
Date
Msg-id CAHZmTm18Ln62KW-G8NYvO1wbBL3QU1E76Zep=DuHmg-zS2XFAg@mail.gmail.com
Whole thread Raw
Responses Re: wal_dump output on CREATE DATABASE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List 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

pgsql-hackers by date:

Previous
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER
Next
From: Fabien COELHO
Date:
Subject: fix psql \conninfo & \connect when using hostaddr