Re: Set new system identifier using pg_resetxlog - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: Set new system identifier using pg_resetxlog
Date
Msg-id 53AC039E.50401@2ndquadrant.com
Whole thread Raw
In response to Re: Set new system identifier using pg_resetxlog  (Sawada Masahiko <sawada.mshk@gmail.com>)
Responses Re: Set new system identifier using pg_resetxlog  (Sawada Masahiko <sawada.mshk@gmail.com>)
List pgsql-hackers
On 25/06/14 19:43, Sawada Masahiko wrote:
> Hi,
>
> I send you review comment about thie patch.

Hello, thanks.

> --
> $ pg_resetxlog -s -n  data | grep "Database system identifier"
> Database system identifier:           6028907917695471865
>
> The -s option does not worksfine with -n option.

Fixed.

> --
> $ pg_resetxlog
> -s6028907917695471865111111111111111111111111111111111111111111111111111111
> data
> Transaction log reset
> $ pg_controldata data | grep "Database system identifier"
> Database system identifier:           18446744073709551615
>
> pg_resetxlog is finished successfully, but system identifier was not
> changed.
> Also I think that checking data about number of digits is needed.
>

It actually did change the identifier, just to ULONG_MAX, since that's
the maximum value that can be set (scanf does that conversion), I added
check that limits the maximum value of system identifier input to
ULONG_MAX-1 and reports error if it's bigger. I also added some
additional input validation.

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

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: better atomics - v0.5
Next
From: Michael Glaesemann
Date:
Subject: Re: sorting a union over inheritance vs pathkeys