Re: Binary difference in pg_internal.init after running pg_initdb multiple times
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Binary difference in pg_internal.init after running pg_initdb multiple times |
| Дата | |
| Msg-id | 19138.1531401884@sss.pgh.pa.us обсуждение |
| Ответ на | Binary difference in pg_internal.init after running pg_initdbmultiple times ("samuel.coulee" <313914592@qq.com>) |
| Список | pgsql-hackers |
"samuel.coulee" <313914592@qq.com> writes:
> In the PG source code function "write_relcache_init_file()", I found that
> the whole 'Relation' structs were directly written into the file
> 'pg_internal.init'. This brings some binary differences of that file, if we
> run pg_initdb multiple times, because the struct 'Relation' contains some
> pointer fields.
There's never been any expectation that that file is bitwise-reproducible.
The order of entries is arbitrary, there are probably alignment padding
bytes that contain garbage, etc etc. So I'm not buying into your apparent
goal here.
> And my question is : Could we clear the pointer values in 'Relation' before
> calling write_item(...)?
No; that's live data with no backup copy. Conceivably we could copy the
structure and zero out useless fields before writing from the copy, but
that adds code, cycles, maintenance effort, and risk of bugs.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера