RE: invalid data in file backup_label problem on windows

Поиск
Список
Период
Сортировка
От wangsh.fnst@fujitsu.com
Тема RE: invalid data in file backup_label problem on windows
Дата
Msg-id OSBPR01MB4214C3E09959ECF9A0A1C8CCF2679@OSBPR01MB4214.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: invalid data in file backup_label problem on windows  (David Steele <david@pgmasters.net>)
Ответы Re: invalid data in file backup_label problem on windows  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
David Steele <david@pgmasters.net> wrote:

> It's not clear to me what text editors have to do with this? Are you
> editing the file manually?

When I execute SELECT * FROM pg_stop_backup(false, true) in psql.

The results will be shown like:
            lsn    |                           labelfile                           | spcmapfile
        ------------+---------------------------------------------------------------------+------------
        0/2000138 | START WAL LOCATION: 0/2000028 (file 000000010000000000000002)+|
                   | CHECKPOINT LOCATION: 0/2000060                               +|
                   | BACKUP METHOD: streamed                                     +|
                   | BACKUP FROM: master                                          +
        ......
The results only will be shown on screen and this function will not generate any files. What I do is write
the second field(labelfile) to a new file backup_label and write the third field(spcmapfile) to tablespace_map if
the third field is not null.

Therefore, I choose a text editor to help me write the file.
I copy the a line in second field and paste this to text editor and press the 'enter' key, repeat this action util
all the line have be pasted to text editor, then save the file.

If this is not a good way to create the backup_label file, can you tell me how can I create this file on windows?


I think the real problem is this file on windows is opened with binary mode. If I use libpq to get the result and write

the result to file directly(the default action on windows is open file in text mode), this problem will be happened.
So I consider this is a bug.

Best Regards,
Shenhao Wang




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: New IndexAM API controlling index vacuum strategies
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Logical Replication vs. 2PC