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