pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Restore OIDs
3+ messages / 3 participants
[nested] [flat]

* Restore OIDs
@ 2006-04-26 10:51 Marcin Kuk <marcin.kuk@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Marcin Kuk @ 2006-04-26 10:51 UTC (permalink / raw)
  To: pgsql-admin

Hi

I have huge problem.
Since 8.1 PostgreSQL don't make an OIDs by default.
I dumped my database from v7.4 and move into v8.1.
I didn't see any errors so it seems to be correct.
If I tried to use database I realise that database have not OID's.
Is any solution to add the OID's into this database after setting
default_with_oids=true.
I don't have time inserting all database again.

I'm not subscribed.
Please CC to me: marcin.kuk@gmail.com

Marcin Kuk



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* restore OIDs
@ 2018-03-16 08:56 Dino Mifsud <dinomifsud74@gmail.com>
  2018-03-16 09:40 ` Re: restore OIDs Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 3+ messages in thread

From: Dino Mifsud @ 2018-03-16 08:56 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

I have a table where I am  storing images in a column of type OID which is
pointing to the pg_largeobject table.


Now when I try do a pg_dump and restore just a schema from one database to
another with the below commands, the OID column in the table is correctly
restored with the original number  but the pg_largeobject table in the
restored database does not contain these OID entries that store the actual
image bytes and therefore the images are not restored.

pg_dump --data-only --host localhost --port 5432 --username "postgres"
--schema=myschema --format custom --verbose --file
"/Users/myuser/Work/databases_backup/original.backup" "db1"

pg_restore --host localhostd --port 5432 --username "postgres"
--schema=myshcema --disable-triggers -d db2
"/Users/myuser/Work/databases_backup/original.backup"



How can I dump and restore correctly just a particular schema?


Thanks

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: restore OIDs
  2018-03-16 08:56 restore OIDs Dino Mifsud <dinomifsud74@gmail.com>
@ 2018-03-16 09:40 ` Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 3+ messages in thread

From: Laurenz Albe @ 2018-03-16 09:40 UTC (permalink / raw)
  To: Dino Mifsud <dinomifsud74@gmail.com>; pgsql-admin@lists.postgresql.org

Dino Mifsud wrote:
> I have a table where I am  storing images in a column of type OID which is
> pointing to the pg_largeobject table. 
> 
> Now when I try do a pg_dump and restore just a schema from one database to another
> with the below commands, the OID column in the table is correctly restored with the
> original number  but the pg_largeobject table in the restored database does not contain
> these OID entries that store the actual image bytes and therefore the images are not restored.
>
> pg_dump --data-only --host localhost --port 5432 --username "postgres" --schema=myschema \
>         --format custom --verbose --file "/Users/myuser/Work/databases_backup/original.backup" "db1"
>
> pg_restore --host localhostd --port 5432 --username "postgres" --schema=myshcema \
>            --disable-triggers -d db2 "/Users/myuser/Work/databases_backup/original.backup"
> 
> 
> How can I dump and restore correctly just a particular schema?

If you use the --schema option, but want to dump large objects too, add the --blobs option.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-03-16 09:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 10:51 Restore OIDs Marcin Kuk <marcin.kuk@gmail.com>
2018-03-16 08:56 restore OIDs Dino Mifsud <dinomifsud74@gmail.com>
2018-03-16 09:40 ` Re: restore OIDs Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox