# Data Explorer：RAW post field 输出中的 \\n 被替换为空格

**URL:** <https://meta.discourse.org/t/data-explorer-n-is-replaced-with-space-in-raw-post-field-output/238743>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [2022 年9 月 12 日 08:01 UTC](https://meta.discourse.org/t/data-explorer-n-is-replaced-with-space-in-raw-post-field-output/238743 "2022-09-12T08:01:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![md-misko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/md-misko/32/126315_2.png) [@md-misko](https://meta.discourse.org/u/md-misko)\
发布日期： [2022 年9 月 12 日 08:01 UTC](https://meta.discourse.org/t/data-explorer-n-is-replaced-with-space-in-raw-post-field-output/238743/1 "2022-09-12T08:01:36Z")

</div>

当使用 rails c 获取原始帖子时，结果包含换行符（正如预期的那样）：

`Post.where('topic_id = 123').last.raw` →   
`"### Title\nParagraph 1\n\nParagraph 2\n\nParagraph 3"`，

但在使用 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 查询时，所有连续的换行符都被替换为单个空格（结果\_不\_等于原始帖子）：

`SELECT raw FROM posts p WHERE p.topic_id = 123 ORDER BY p.id DESC LIMIT 1` →   
`### Title Paragraph 1 Paragraph 2 Paragraph 3`

原始帖子字段不应该包含换行符吗，还是这是 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 的限制？

我真的很想从 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 查询中获取完整的原始帖子。

---

_[View the full topic](https://meta.discourse.org/t/data-explorer-n-is-replaced-with-space-in-raw-post-field-output/238743)._
