0

I am trying to import a sql dump to postgresql db as -

sudo su postgres -c psql dbname < mydb_dump.sql 

This gives errors as -

SET
SET
SET
SET
SET
SET
ERROR:  function "array_accum" already exists with same argument types
ALTER AGGREGATE
ERROR:  function "c" already exists with same argument types
ALTER AGGREGATE
ERROR:  duplicate key value violates unique constraint "pg_ts_config_cfgname_index"
ERROR:  duplicate key value violates unique constraint "pg_ts_config_map_index"

and so on this. What might be wrong with that? Tried googling for it, but couldn't find any pointers over it.

Postgresql version is 8.4.1

Thanks !!

3
  • 1
    Does : stackoverflow.com/questions/1797954/… help? Commented Dec 15, 2011 at 12:20
  • What PostgreSQL version was used to create that dump? Commented Dec 15, 2011 at 13:28
  • Kai's comment did helped. Different command users there worked nice !! Commented Dec 15, 2011 at 20:54

1 Answer 1

1

you should to remove shared functions and objects from database, before you do dump or before you load dump. You have these functions and objects registered in template1, and when you create new database, then these objects are there - and you can see errors when dump try to create it again.

This issue is well solved in PostgreSQL 9.1. For older versions try to use option --clean for pg_dump

Pavel

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.