Thread: pgsql: Add -f/--follow option to pg_xlogdump.
Add -f/--follow option to pg_xlogdump. This is useful for seeing what WAL records are inserted in real-time, by pointing pg_xlogdump to a live server. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/ce9bb92f8fb8d25cf00ec939797ffdb5930fb792 Modified Files -------------- contrib/pg_xlogdump/pg_xlogdump.c | 31 ++++++++++++++++++++++++++++--- doc/src/sgml/pg_xlogdump.sgml | 11 +++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-)
On 03/26/2014 07:50 AM, Heikki Linnakangas wrote: > Add -f/--follow option to pg_xlogdump. > > This is useful for seeing what WAL records are inserted in real-time, by > pointing pg_xlogdump to a live server. > > Branch > ------ > master > > Details > ------- > http://git.postgresql.org/pg/commitdiff/ce9bb92f8fb8d25cf00ec939797ffdb5930fb792 > > Modified Files > -------------- > contrib/pg_xlogdump/pg_xlogdump.c | 31 ++++++++++++++++++++++++++++--- > doc/src/sgml/pg_xlogdump.sgml | 11 +++++++++++ > 2 files changed, 39 insertions(+), 3 deletions(-) > > Seems to have upset Windows (see <http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=currawong&dt=2014-03-26%2012%3A30%3A44>). Shouldn't you be using pg_usleep() instead of sleep()? cheers andrew
On 03/26/2014 03:15 PM, Andrew Dunstan wrote: > > On 03/26/2014 07:50 AM, Heikki Linnakangas wrote: >> Add -f/--follow option to pg_xlogdump. >> >> This is useful for seeing what WAL records are inserted in real-time, by >> pointing pg_xlogdump to a live server. >> >> Branch >> ------ >> master >> >> Details >> ------- >> http://git.postgresql.org/pg/commitdiff/ce9bb92f8fb8d25cf00ec939797ffdb5930fb792 >> >> Modified Files >> -------------- >> contrib/pg_xlogdump/pg_xlogdump.c | 31 ++++++++++++++++++++++++++++--- >> doc/src/sgml/pg_xlogdump.sgml | 11 +++++++++++ >> 2 files changed, 39 insertions(+), 3 deletions(-) >> > > > Seems to have upset Windows (see > <http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=currawong&dt=2014-03-26%2012%3A30%3A44>). > > Shouldn't you be using pg_usleep() instead of sleep()? Apparently. Fixed that way. I'm surprised that pg_upgrade doesn't have the same problem - there's a plain sleep(1) call in contrib/pg_upgrade/exec.c. What's the difference? - Heikki
On 03/26/2014 09:27 AM, Heikki Linnakangas wrote: > On 03/26/2014 03:15 PM, Andrew Dunstan wrote: >> >> On 03/26/2014 07:50 AM, Heikki Linnakangas wrote: >>> Add -f/--follow option to pg_xlogdump. >>> >>> This is useful for seeing what WAL records are inserted in >>> real-time, by >>> pointing pg_xlogdump to a live server. >>> >>> Branch >>> ------ >>> master >>> >>> Details >>> ------- >>> http://git.postgresql.org/pg/commitdiff/ce9bb92f8fb8d25cf00ec939797ffdb5930fb792 >>> >>> >>> Modified Files >>> -------------- >>> contrib/pg_xlogdump/pg_xlogdump.c | 31 >>> ++++++++++++++++++++++++++++--- >>> doc/src/sgml/pg_xlogdump.sgml | 11 +++++++++++ >>> 2 files changed, 39 insertions(+), 3 deletions(-) >>> >> >> >> Seems to have upset Windows (see >> <http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=currawong&dt=2014-03-26%2012%3A30%3A44>). >> >> >> Shouldn't you be using pg_usleep() instead of sleep()? > > Apparently. Fixed that way. > > I'm surprised that pg_upgrade doesn't have the same problem - there's > a plain sleep(1) call in contrib/pg_upgrade/exec.c. What's the difference? pg_upgrade.h has: #ifdef WIN32 #define sleep(x) Sleep(x * 1000) #endif Which is another way of doing it, I guess. I'm not sure why the usual way wasn't adopted there. cheers andrew
On Wed, Mar 26, 2014 at 10:42 PM, Andrew Dunstan <andrew@dunslane.net> wrote: > Which is another way of doing it, I guess. I'm not sure why the usual way > wasn't adopted there. Perhaps it was simply forgotten, it is done like that since pg_upgrade a couple of years back with c2e9b2f. -- Michael
On Wed, Mar 26, 2014 at 10:54:04PM +0900, Michael Paquier wrote: > On Wed, Mar 26, 2014 at 10:42 PM, Andrew Dunstan <andrew@dunslane.net> wrote: > > Which is another way of doing it, I guess. I'm not sure why the usual way > > wasn't adopted there. > Perhaps it was simply forgotten, it is done like that since pg_upgrade > a couple of years back with c2e9b2f. Yes, I think Sleep() was left over from when pg_upgrade was not in contrib. I have committed a patch to use pg_usleep(). Thanks. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +