pgsql: Add -f/--follow option to pg_xlogdump.
pgsql: Add -f/--follow option to pg_xlogdump.
От:
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Дата:
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(-)
Re: pgsql: Add -f/--follow option to pg_xlogdump.
От:
Andrew Dunstan <andrew@dunslane.net>
Дата:
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 ). Shouldn't you be using pg_usleep() instead of sleep()? cheers andrew
Re: pgsql: Add -f/--follow option to pg_xlogdump.
От:
Heikki Linnakangas <hlinnakangas@vmware.com>
Дата:
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 > ). > > 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
Re: pgsql: Add -f/--follow option to pg_xlogdump.
От:
Andrew Dunstan <andrew@dunslane.net>
Дата:
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
>> ).
>>
>>
>> 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
Re: pgsql: Add -f/--follow option to pg_xlogdump.
От:
Michael Paquier <michael.paquier@gmail.com>
Дата:
On Wed, Mar 26, 2014 at 10:42 PM, Andrew Dunstan 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
Re: pgsql: Add -f/--follow option to pg_xlogdump.
От:
Bruce Momjian <bruce@momjian.us>
Дата:
On Wed, Mar 26, 2014 at 10:54:04PM +0900, Michael Paquier wrote: > On Wed, Mar 26, 2014 at 10:42 PM, Andrew Dunstan 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 http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +