Re: Further pg_upgrade analysis for many tables

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Further pg_upgrade analysis for many tables
Дата
Msg-id 20121112213235.GG14488@momjian.us
обсуждение исходный текст
Ответ на Re: Further pg_upgrade analysis for many tables  (Bruce Momjian <bruce@momjian.us>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Further pg_upgrade analysis for many tables
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Proof of concept: standalone backend with full FE/BE protocol