[pgsql-jp: 39440] Re: Q) mysqlからの移植 insert でのエスケープ

User ken ken @ tydfam.jp
2008年 6月 19日 (木) 20:47:01 JST


  山田@町田市です。

 間違ったファイルを添付してしまったかもしれません。 極く、常識的なところは直して、そのまま入力しようとすると、下のようなメッセージが出るのですが、この意味がイマイチ分からないのですが,,,。

 宜しくお願いします。

portal=# \i /tmp/test1.sql
psql:/tmp/test1.sql:1: WARNING:  nonstandard use of escape in a string literal
LINE 1: ..., HEADER, HEADER_MACROS, NAME_AS_TITLE) VALUES (7,'Most cont...
                                                             ^
HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
psql:/tmp/test1.sql:1: ERROR:  column "enable_comment_form" is of type bit but expression is of type boolean
LINE 1: ... WIKI_DOCUMENT (NODE_ID, CONTENT, CONTENT_MACROS, ENABLE_COM...
                                                             ^
HINT:  You will need to rewrite or cast the expression.
portal=# 

以下、入力に使ったファイルです。

INSERT INTO WIKI_DOCUMENT (NODE_ID, CONTENT, CONTENT_MACROS, ENABLE_COMMENT_FORM, ENABLE_COMMENTS, ENABLE_COMMENTS_ON_FEEDS, FOOTER, FOOTER_MACROS, HEADER, HEADER_MACROS, NAME_AS_TITLE) VALUES (7,'Most content on this website (blogs, blog comments, wiki pages, user profiles) is rendered using the [Seam Text=>http://docs.jboss.com/seam/latest/reference/en/html/text.html] engine. If you are creating content, it helps to know a few simple tricks.\n\n++ Basic formatting\n\nYou can emphasize words using *emphasis*, _underline_, ~strikeout~ or ^superscript^.\n\n`You can emphasize words using\n*emphasis*, _underline_, ~strikeout~ or ^superscript^.`\n\nBut if you really want to type a special character such as \\* or \\+, you need to escape it with a \\\\.\n\n`But if you really want to type a special character\nsuch as \\* or \\+, you need to escape it with a \\\\.`\n\nAlternatively, you can use special characters freely inside |monospace text|.\n\n`Alternatively, you can use special characters freely\ninside |monospace text|.`\n\n++ Block formatting\n\nOf course, you can also use \"inline quotes\".\n\n\"And block quotes.\"\n\nAnd split text across several paragraphs.\n\n`Of course, you can also use \"inline quotes\".\n\n\"And block quotes.\"\n\nAnd split text across several paragraphs.`\n\nYou can create\n\n= unorderedlists\n= of stuff\n= like this\n\nor\n\n# numbered lists\n# of other things\n\n`You can create\n= unordered lists\n= of stuff\n= like this\n\nor\n\n# numbered lists\n# of other things`\n\n++ Code Blocks\n\nA third option for embedding text that uses special characters is to use a code block, delimited by `backticks`. For example:\n\n<pre>\\`for (int i\\=0; i\\<100; i\\+\\+) {\n   log.info(\\\"Hello world!\\\");\n}\\`</pre>\n\n+ Here is a first-level heading\n\nHere is a normal paragraph.\n\n++ Here is a second-level heading\n\nAnd another paragraph.\n\n`+ Here is a first-level heading\n\nHere is a normal paragraph.\n\n++ Here is a second-level heading\n\nAnd another paragraph.`\n\n++ Links\n\nThe wiki has powerful handling for links.\n\nHTML links to [=>http://hibernate.org] or attach the link to [some link text=>http://hibernate.org].\nMy [e-mail address=>mailto:foo @ bar.tld] will be automatically protected.\n\n`HTML links to [=>http://hibernate.org] or attach the\nlink to [some link text=>http://hibernate.org].\nMy [e-mail address=>mailto:foo @ bar.tld] will be\nautomatically protected.`\n\nInternal wiki links simply use area and document/file names:\n\n= Link to  another document: \\[\\=\\>My Document\\] \n= Link to another document with link text: \\[A document\\=\\>My Document\\]\n= Link to another document in another area: \\[\\=\\>Another Area\\|My Document\\]\n= Link to an uploaded file or image: \\[\\=\\>My Upload\\]\n\nYou can even link to a [Hibernate JIRA issue=>hhh://2702], or a\n[Seam JIRA issue=>jbseam://1920].\n\n`You can even link to a [Hibernate JIRA issue=>hhh://2702],\nor a [Seam JIRA issue=>jbseam://1920].`\n\n++ Embedded HTML\n\nYou can even use <i>many</i> HTML tags directly, but <b>not</b> tags that would create a security vulnerability!\n\n`You can even use <i>many</i> HTML tags directly,\nbut <b>not</b> tags that would create a\nsecurity vulnerability!`',NULL,false,false,false,NULL,NULL,NULL,NULL,true);



pgsql-jp メーリングリストの案内