Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-14 Thread Robert Haas
On Jul 13, 2012, at 2:34 PM, Peter Eisentraut pete...@gmx.net wrote: I would rather get rid of this %X/%X notation. I know we have all grown to like it, but it's always been a workaround. We're now making the move to simplify this whole business by saying, the WAL location is an unsigned

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-13 Thread Peter Eisentraut
On tor, 2012-07-12 at 10:13 +0300, Heikki Linnakangas wrote: One idea would be to use a macro, like this: #define XLOGRECPTR_FMT_ARGS(recptr) (uint32) ((recptr) 32), (uint32) (recptr) elog(LOG, current WAL location is %X/%X, XLOGRECPTR_FMT_ARGS(RecPtr)); I would rather get rid of

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-13 Thread Bruce Momjian
On Fri, Jul 13, 2012 at 10:34:35PM +0300, Peter Eisentraut wrote: On tor, 2012-07-12 at 10:13 +0300, Heikki Linnakangas wrote: One idea would be to use a macro, like this: #define XLOGRECPTR_FMT_ARGS(recptr) (uint32) ((recptr) 32), (uint32) (recptr) elog(LOG, current WAL

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-13 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Fri, Jul 13, 2012 at 10:34:35PM +0300, Peter Eisentraut wrote: I would rather get rid of this %X/%X notation. +1 I'm for it if we can find a less messy way of dealing with the platform-specific-format-code issue. I don't want to be plugging

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-12 Thread Heikki Linnakangas
On 07.07.2012 01:03, Peter Eisentraut wrote: On tis, 2012-07-03 at 14:52 -0400, Tom Lane wrote: Peter Eisentrautpete...@gmx.net writes: On tis, 2012-07-03 at 19:35 +0200, Andres Freund wrote: I wonder if we just should add a format code like %R or something similar as a replacement for the

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-06 Thread Peter Eisentraut
On tis, 2012-07-03 at 14:52 -0400, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: On tis, 2012-07-03 at 19:35 +0200, Andres Freund wrote: I wonder if we just should add a format code like %R or something similar as a replacement for the %X/%X notion. Maybe just print it as

[HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-03 Thread Andres Freund
Hi, I wonder if we just should add a format code like %R or something similar as a replacement for the %X/%X notion. Having to type something like (uint32) (state-curptr 32), (uint32)state-curptr everywhere is somewhat annoying. Opinions? Andres -- Andres Freund

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-03 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: I wonder if we just should add a format code like %R or something similar as a replacement for the %X/%X notion. Only if you can explain how to teach gcc what it means for elog argument match checking. %m is a special case in that it matches up

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-03 Thread Peter Eisentraut
On tis, 2012-07-03 at 19:35 +0200, Andres Freund wrote: I wonder if we just should add a format code like %R or something similar as a replacement for the %X/%X notion. Having to type something like (uint32) (state-curptr 32), (uint32)state-curptr everywhere is somewhat annoying. Maybe

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-03 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On tis, 2012-07-03 at 19:35 +0200, Andres Freund wrote: I wonder if we just should add a format code like %R or something similar as a replacement for the %X/%X notion. Maybe just print it as a single 64-bit value from now on. That'd be problematic

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-03 Thread Andres Freund
On Tuesday, July 03, 2012 08:09:40 PM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: I wonder if we just should add a format code like %R or something similar as a replacement for the %X/%X notion. Only if you can explain how to teach gcc what it means for elog argument match

Re: [HACKERS] Support for XLogRecPtr in expand_fmt_string?

2012-07-03 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On Tuesday, July 03, 2012 08:09:40 PM Tom Lane wrote: If we really feel this is worth doing something about, we could invent a formatting subroutine that converts XLogRecPtr to string (and then we just use %s in the messages). I think that would