Xml 在postgresql中使用copy?
有一个表包含3列mydocsid serial、docform integer和content text 将id=30的mydocs中的select内容复制到'D:/html/ex10.xml' 我用这个表达式选择1行id=30,并将其中的内容文本放入带有路径的文件夹中。 它有效,但是Xml 在postgresql中使用copy?,xml,database,postgresql,psql,Xml,Database,Postgresql,Psql,有一个表包含3列mydocsid serial、docform integer和content text 将id=30的mydocs中的select内容复制到'D:/html/ex10.xml' 我用这个表达式选择1行id=30,并将其中的内容文本放入带有路径的文件夹中。 它有效,但是 <?xml version="1.0" encoding="utf-8"?> \r\n <tutorial> \r\n <title>"Заметки об
<?xml version="1.0" encoding="utf-8"?>
\r\n
<tutorial>
\r\n
<title>"Заметки об XSL"</title>
\r\n
<author>лермонтов</author>
\r\n
</tutorial>
这是在psql中
insert into mydocs(docform,content)
values (3, convert_from(bytea_import('D:/html/ex08.xml'), 'utf-8'));
我不太清楚内容到底是什么样子的,但是这些变体中的一个应该可以工作:
copy (select (replace(content, e'\r\n', '')) from mydocs where id=30 ) to 'c:/data/ex10.xml';
copy (select (replace(content, '\r\n', '')) from mydocs where id=30 ) to 'c:/data/ex10.xml';
copy (select (replace(content, e'\r\n', '')) from mydocs where id=30 ) to 'c:/data/ex10.xml';
copy (select (replace(content, '\r\n', '')) from mydocs where id=30 ) to 'c:/data/ex10.xml';