# Mover uma postagem falha em circunstâncias desconhecidas

**URL:** <https://meta.discourse.org/t/moving-a-post-fails-in-unknown-circumstances/77983>\
**Category:** Bug\
**Created:** [Janeiro 14, 2018, 10:01am UTC](https://meta.discourse.org/t/moving-a-post-fails-in-unknown-circumstances/77983 "2018-01-14T10:01:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [Janeiro 14, 2018, 10:01am UTC](https://meta.discourse.org/t/moving-a-post-fails-in-unknown-circumstances/77983/1 "2018-01-14T10:01:38Z")

</div>

When trying to move a single post into a new topic, it fails with:

```
[db8237] Processing by TopicsController#move_posts as */*
[db8237] Parameters: {"title"=>"importer 3 fichiers", "post_ids"=>["4455"], "category_id"=>"6", "topic_id"=>"1521"}
[db8237] Completed 500 Internal Server Error in 336ms (ActiveRecord: 108.5ms)
[db8237] ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_posts_on_topic_id_and_post_number"
DETAIL: Key (topic_id, post_number)=(1521, 3) already exists.

```

However, that is the post I’m trying to move.

```
db8237=# select id,post_number from posts where topic_id=1521;
  id | post_number 
------+-------------
 4085 | 1
 4151 | 2
 4455 | 3

```

`reindex index index_posts_on_topic_id_and_post_number;` did not help.

Does anyone have any idea where to look? Or did we trigger an obscure bug here?

---

_[View the full topic](https://meta.discourse.org/t/moving-a-post-fails-in-unknown-circumstances/77983)._
