0

I need to transfer db from PostgreSQL 12 to PostgreSQL 9.2.24. I try make backup my db from PostgreSQL 12 and restore on PostgreSQL 9.2.24 but I can't do it because have an error like this:

LINE 1: SELECT pg_catalog.setval('public.schemas_headers_types_id_se...
                                 ^


LINE 2:     ADD CONSTRAINT user_id PRIMARY KEY (id) INCLUDE (id);
                                                    ^
Command was: ALTER TABLE ONLY public.users

...

I can't update db version from PostgreSQL 9.2.24 to PostgreSQL 12 because my hosting provider doesn't allow me to do it. How i can't truly transfer my db from PostgreSQL 12 to PostgreSQL 9.2.24?

1

2 Answers 2

1

You would have to edit the dump to remove the INCLUDE (id) (which is a pretty useless use of the INCLUDE feature anyway, to include the same column twice). But who knows how many following on errors you will find?

my hosting provider doesn't allow me to do it

Seems like the real solution then is find a different hosting provider.

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

Comments

0

pg_dump says...

Also, it is not guaranteed that pg_dump's output can be loaded into a server of an older major version — not even if the dump was taken from a server of that version. Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server. Use of the --quote-all-identifiers option is recommended in cross-version cases, as it can prevent problems arising from varying reserved-word lists in different PostgreSQL versions.

include is a feature which simply does not exist in Postgres 9.2. These and other features will have to be replaced with alternates, if possible.

9.2.24 reached its end-of-life in November 2017. It's possible you can use this fact to get your provider to upgrade. If not, consider whether you want to use a hosting provider which refuses to update software which is no longer supported.

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.