Re: Restore backup file "with oids"

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org, gmail Vladimir Koković <vladimir(dot)kokovic(at)gmail(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: Restore backup file "with oids"
Date: 2019-12-18 18:34:57
Message-ID: A23B66BD-E6B5-4917-8391-3DBACCABB68E@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18 December 2019 19:28:07 EET, "gmail Vladimir Koković" <vladimir(dot)kokovic(at)gmail(dot)com> wrote:
>Is there somewhere a script that can do a restore backup file "with
>oids" in some newer DB where there is no term "with oids"?

There is nothing automatic, some manual work is needed. A couple of ideas:

1. Install an older version of PostgreSQL that still supports WITH OIDS, and restore the dump there. Use ALTER TABLE SET WITHOUT OIDS, and dump the database again (preferably with v12 of pg_dump).

2. Create the table manually, but with a regular oid-type column in place of the system column. Do a data-only restore.

You didn't mention what format the backup dump is. If it's in custom format, you can do a data-only restore easily. If it's a text sql file, and it's not too large, you can load it in a text exitor and edit manually.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-12-18 18:37:21 Re: Read Uncommitted
Previous Message Robert Haas 2019-12-18 18:26:31 Re: Read Uncommitted