1

I'm using PostgreSQL locally and everything is working as expected. However, when I decided to move/restore the database to the staging environment I am getting this error (even through the tables do not exist).

Has anyone experienced this before?

restore_pg_11.0: [archiver (db)] could not execute query: ERROR:  relation "assetindexdata_id_seq" already exists
    Command was: CREATE SEQUENCE public.assetindexdata_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
1

Not sure how the database backup was created and what's being used to restore it, but using this would fix the error:

CREATE SEQUENCE IF NOT EXISTS 'public.assetindexdata_id_seq'

Alternatively, if you delete the database to destroy all of the associated metadata, then it shouldn't matter.

https://www.postgresql.org/docs/9.5/sql-createsequence.html

| improve this answer | |
  • I used multiple methods with the same results, latest Craft backup but lets see if that works. – Jason McCallister Jul 9 '19 at 17:18
  • This did the trick, there was a previous install on the database that was dropped but the sequence was still there. Thanks Brad! – Jason McCallister Jul 9 '19 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.