rm_desc signature

Started by Heikki Linnakangasalmost 12 years ago6 messageshackers
Jump to latest
#1Heikki Linnakangas
heikki.linnakangas@enterprisedb.com

As part of the WAL-format changing patch I've been working on, I changed
the signature of the rm_desc function from:

void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec);
void (*rm_desc) (StringInfo buf, XLogRecord *record);

The WAL-format patch needed that because it added more functions/macros
for working with XLogRecords, also used by rm_desc routines, but it
seems like a sensible change anyway. IMHO it was always a bit strange
that rm_desc was passed the info field and record payload separately.

So I propose to do that change as a separate commit. Per attached. This
has no functional changes, it's just refactoring.

Any objections?

- Heikki

Attachments:

rm_desc-signature-change-1.patchtext/x-diff; name=rm_desc-signature-change-1.patchDownload+82-69
#2Andres Freund
andres@anarazel.de
In reply to: Heikki Linnakangas (#1)
Re: rm_desc signature

On 2014-06-13 14:37:33 +0300, Heikki Linnakangas wrote:

As part of the WAL-format changing patch I've been working on, I changed the
signature of the rm_desc function from:

void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec);
void (*rm_desc) (StringInfo buf, XLogRecord *record);

The WAL-format patch needed that because it added more functions/macros for
working with XLogRecords, also used by rm_desc routines, but it seems like a
sensible change anyway. IMHO it was always a bit strange that rm_desc was
passed the info field and record payload separately.

+1. I've found this annoying in the past.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Fujii Masao
masao.fujii@gmail.com
In reply to: Andres Freund (#2)
Re: rm_desc signature

On Fri, Jun 13, 2014 at 8:39 PM, Andres Freund <andres@2ndquadrant.com> wrote:

On 2014-06-13 14:37:33 +0300, Heikki Linnakangas wrote:

As part of the WAL-format changing patch I've been working on, I changed the
signature of the rm_desc function from:

void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec);
void (*rm_desc) (StringInfo buf, XLogRecord *record);

The WAL-format patch needed that because it added more functions/macros for
working with XLogRecords, also used by rm_desc routines, but it seems like a
sensible change anyway. IMHO it was always a bit strange that rm_desc was
passed the info field and record payload separately.

+1, too.

-/* #define WAL_DEBUG */
+#define WAL_DEBUG

ISTM you just forgot to exclude this change from the patch.

Regards,

--
Fujii Masao

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Andres Freund (#2)
Re: rm_desc signature

At 2014-06-13 13:39:58 +0200, andres@2ndquadrant.com wrote:

void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec);
void (*rm_desc) (StringInfo buf, XLogRecord *record);

[…]

+1. I've found this annoying in the past.

I like it too. I was just moving some code from pg_xlogdump into another
(new) rm_desc-like callback, and passing in the XLogRecord makes much
more sense to me.

-- Abhijit

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Jeff Janes
jeff.janes@gmail.com
In reply to: Heikki Linnakangas (#1)
Re: rm_desc signature

On Friday, June 13, 2014, Heikki Linnakangas <hlinnakangas@vmware.com>
wrote:

As part of the WAL-format changing patch I've been working on, I changed
the signature of the rm_desc function from:

void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec);
void (*rm_desc) (StringInfo buf, XLogRecord *record);

The WAL-format patch needed that because it added more functions/macros
for working with XLogRecords, also used by rm_desc routines, but it seems
like a sensible change anyway. IMHO it was always a bit strange that
rm_desc was passed the info field and record payload separately.

So I propose to do that change as a separate commit. Per attached. This
has no functional changes, it's just refactoring.

Any objections?

This commit, or a related one, changed the default (i.e. commented out)
nature of:

#define WAL_DEBUG

Cheers,

Jeff

#6Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Jeff Janes (#5)
Re: rm_desc signature

On 06/17/2014 04:19 AM, Jeff Janes wrote:

This commit, or a related one, changed the default (i.e. commented out)
nature of:

#define WAL_DEBUG

Oops. Fixed, thanks!

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers