pg_dbms_stats icon indicating copy to clipboard operation
pg_dbms_stats copied to clipboard

on Windows / import ERROR by newline code difference

Open harukat opened this issue 1 year ago • 0 comments

First, I am happy to report that pg_dbms_stats works fine on Windows (MSVC build), as far as I can tell, except as noted below.

The export scripts export_effective_stats-*.sql.samle and export_plain_stats-*.sql.sample doesn't work in Windows OS because of newline code difference. It causes the following error when importing.

db1=# SELECT dbms_stats.import_table_stats('public', 't1', 'C:\pdata\14.10\export_stats.dmp');
ERROR:  COPY file signature not recognized

I was able to avoid this error by writing TO 'server-side file path' instead of using \o and TO STDOUT in the scripts. I would suggest adding scripts like this for Windows.

harukat avatar Dec 15 '23 08:12 harukat