Title: [Plugin: PostgreSQL for WordPress (PG4WP)] Error on wp_insert_post
Last modified: August 20, 2016

---

# [Plugin: PostgreSQL for WordPress (PG4WP)] Error on wp_insert_post

 *  Resolved [velocityzen](https://wordpress.org/support/users/velocityzen/)
 * (@velocityzen)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-postgresql-for-wordpress-pg4wp-error-on-wp_insert_post/)
 * Hello
    My plugin tried to post some stuff and I’ve got:
 *     ```
       WP_Error Object ( [errors] => Array ( [db_insert_error] => Array ( [0] => Could not insert post into the database ) ) [error_data] => Array ( [db_insert_error] => ERROR: duplicate key value violates unique constraint "mood_posts_pkey" DETAIL: Key ("ID")=(39) already exists. ) )
       ```
   
 * I have clean wordpress install with imported old posts (tool > import), and I
   don’t specify any id on insert.
    Postgres 9.1
 * [http://wordpress.org/extend/plugins/postgresql-for-wordpress/](http://wordpress.org/extend/plugins/postgresql-for-wordpress/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [velocityzen](https://wordpress.org/support/users/velocityzen/)
 * (@velocityzen)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-postgresql-for-wordpress-pg4wp-error-on-wp_insert_post/#post-2592175)
 * I’m trying to insert data again and post ID in error message is incrementing
   `
   Key ("ID")=(59) already exists.`
 *  Thread Starter [velocityzen](https://wordpress.org/support/users/velocityzen/)
 * (@velocityzen)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-postgresql-for-wordpress-pg4wp-error-on-wp_insert_post/#post-2592433)
 * I’m figure out that posts_seq has not updated it value after wp-import. Maybe
   it’s wp-import’s bug. I fixed it through pgphpadmin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: PostgreSQL for WordPress (PG4WP)] Error on wp_insert_post’ is
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/postgresql-for-wordpress.svg)
 * [PostgreSQL for WordPress (PG4WP)](https://wordpress.org/plugins/postgresql-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/postgresql-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/postgresql-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/postgresql-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/postgresql-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/postgresql-for-wordpress/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [velocityzen](https://wordpress.org/support/users/velocityzen/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-postgresql-for-wordpress-pg4wp-error-on-wp_insert_post/#post-2592433)
 * Status: resolved