Thread: Restore backup file "with oids"

Restore backup file "with oids"

From
gmail Vladimir Koković
Date:

Hi,

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"?


Vladimir Koković, DP senior(69)
Serbia, Belgrade, 18.December 2019

Re: Restore backup file "with oids"

From
Fabrízio de Royes Mello
Date:
On Wed, Dec 18, 2019 at 2:28 PM gmail Vladimir Koković <vladimir.kokovic@gmail.com> wrote:

Hi,

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"?



Short answer: No!

Long answer: try use the pg_dump binary from your new version (12) connecting to your old version... is the best practice when you want to upgrade your PostgreSQL using dump/restore strategy.

Regards,

--
   Fabrízio de Royes Mello         Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

Re: Restore backup file "with oids"

From
Heikki Linnakangas
Date:
On 18 December 2019 19:28:07 EET, "gmail Vladimir Koković" <vladimir.kokovic@gmail.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
SETWITHOUT 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'sa text sql file, and it's not too large, you can load it in a text exitor and edit manually. 

- Heikki



Re: Restore backup file "with oids"

From
Vladimir Koković
Date:

HI,

The first thing I have to say is that I only have a plain backup file "with oids" from "PostgreSQL 8.4.2, 32-bit",

from which I should take the contents of some tables.
Any help from someone who was in a similar situation would help me a lot in resolving this situation.

Thank you Heikki for your solution.


Vladimir Koković, DP senior(69)
Serbia, Belgrade, 18.December 2019


On 18.12.19. 19:34, Heikki Linnakangas wrote:
On 18 December 2019 19:28:07 EET, "gmail Vladimir Koković" <vladimir.kokovic@gmail.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


Re: Restore backup file "with oids"

From
Osahon Oduware
Date:
THE TRUTH CANNOT BE HIDDEN
**Explosion in my car.....

On Wed, 18 Dec 2019, 18:28 gmail Vladimir Koković, <vladimir.kokovic@gmail.com> wrote:

Hi,

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"?


Vladimir Koković, DP senior(69)
Serbia, Belgrade, 18.December 2019

Re: Restore backup file "with oids"

From
"David G. Johnston"
Date:
On Wednesday, December 18, 2019, Vladimir Koković <vladimir.kokovic@a-asoft.com> wrote:

HI,

The first thing I have to say is that I only have a plain backup file "with oids" from "PostgreSQL 8.4.2, 32-bit",

from which I should take the contents of some tables.
Any help from someone who was in a similar situation would help me a lot in resolving this situation

Restore it into 9.4 and see if you can get what you need from there?

David J.