Re: Further pg_upgrade analysis for many tables - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Further pg_upgrade analysis for many tables
Date
Msg-id 20121112213235.GG14488@momjian.us
Whole thread Raw
In response to Re: Further pg_upgrade analysis for many tables  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Mon, Nov 12, 2012 at 12:09:08PM -0500, Bruce Momjian wrote:
> The second approach would be to simply try to copy the fsm, vm, and
> extent files, and ignore any ENOEXIST errors.  This allows code
> simplification.  The downside is that it doesn't pull all files with
> matching prefixes --- it requires pg_upgrade to _know_ what suffixes
> might exist in that directory.  Second, it assumes there can be no
> number gaps in the file extent numbering (is that safe?).

Seems our code does the same kind of segment number looping I was
suggesting for pg_upgrade, so I think I am safe:
       /*        * Note that because we loop until getting ENOENT, we will correctly        * remove all inactive
segmentsas well as active ones.        */       for (segno = 1;; segno++)       {           sprintf(segpath, "%s.%u",
path,segno);           if (unlink(segpath) < 0)           {               /* ENOENT is expected after the last
segment...*/               if (errno != ENOENT)                   ereport(WARNING,
(errcode_for_file_access(),                     errmsg("could not remove file \"%s\": %m", segpath)));
break;          }       }
 

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Further pg_upgrade analysis for many tables
Next
From: Simon Riggs
Date:
Subject: Re: Proof of concept: standalone backend with full FE/BE protocol