pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedrestoring large objects
6+ messages / 2 participants
[nested] [flat]
* restoring large objects
@ 2004-04-06 12:02 Marion McKelvie <marion@streamlet.co.uk>
0 siblings, 1 reply; 6+ messages in thread
From: Marion McKelvie @ 2004-04-06 12:02 UTC (permalink / raw)
To: pgsql-admin
Please can anyone confirm (or otherwise) the situation with restoring large
objects?
I am running with 7.1.2 (I know it's old, but I don't have a lot of choice
given the application running on it), and have dumped the database with
the -b option. However, the restoration process generates new ids for the
large objects which means the link between the data table referencing them
and the content of pg_largeobject is lost. I have seen a reference in the
list archives to this being a bug, but can not find any reference to a
workround or resolution. Does anyone know if there is one?
I have a separate newer installation on 7.3.4. Is this still a problem on
the newer versions?
Many thanks for any assistance
Marion
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: restoring large objects
@ 2004-04-06 15:32 Tom Lane <tgl@sss.pgh.pa.us>
parent: Marion McKelvie <marion@streamlet.co.uk>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2004-04-06 15:32 UTC (permalink / raw)
To: Marion McKelvie <marion@streamlet.co.uk>; +Cc: pgsql-admin
"Marion McKelvie" <marion@streamlet.co.uk> writes:
> I am running with 7.1.2 (I know it's old, but I don't have a lot of choice
> given the application running on it), and have dumped the database with
> the -b option. However, the restoration process generates new ids for the
> large objects which means the link between the data table referencing them
> and the content of pg_largeobject is lost.
pg_dump includes code in the dump that is supposed to update references
to match the new large object OIDs. Check into why that didn't work
for you. (One fairly likely possibility is that you stored the
references in the wrong type of column --- it has to be type "oid" or
"lo" or pg_dump won't think it needs updating.)
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: restoring large objects
@ 2004-04-06 15:46 Marion McKelvie <marion@streamlet.co.uk>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Marion McKelvie @ 2004-04-06 15:46 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
Tom
Many thanks - you're right, the references are stored (by the application
using the database) in a column of type text. That presumably means the
only way I can get a reliably restorable dump is by writing something
myself... or adding an extra duplicate column which is of type oid... or
something which somehow tracks the old and new ids... an interesting
challenge!
Regards,
Marion
-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: 06 April 2004 16:33
To: Marion McKelvie
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] restoring large objects
"Marion McKelvie" <marion@streamlet.co.uk> writes:
> I am running with 7.1.2 (I know it's old, but I don't have a lot of choice
> given the application running on it), and have dumped the database with
> the -b option. However, the restoration process generates new ids for the
> large objects which means the link between the data table referencing them
> and the content of pg_largeobject is lost.
pg_dump includes code in the dump that is supposed to update references
to match the new large object OIDs. Check into why that didn't work
for you. (One fairly likely possibility is that you stored the
references in the wrong type of column --- it has to be type "oid" or
"lo" or pg_dump won't think it needs updating.)
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: restoring large objects
@ 2004-04-07 06:07 Tom Lane <tgl@sss.pgh.pa.us>
parent: Marion McKelvie <marion@streamlet.co.uk>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2004-04-07 06:07 UTC (permalink / raw)
To: Marion McKelvie <marion@streamlet.co.uk>; +Cc: pgsql-admin
"Marion McKelvie" <marion@streamlet.co.uk> writes:
> Many thanks - you're right, the references are stored (by the application
> using the database) in a column of type text.
Yuck :-(. A possible solution is to dump the schema and data separately
(schema in a plain text dump, data in an -Fc or -Ft dump since plain
text doesn't support dumping LOs). Then manually edit the schema file
to change the column data type to "oid". Then load. I honestly am not
sure that this will work cleanly, but it's worth trying --- and if it
doesn't work, please let me know where it goes wrong.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: restoring large objects
@ 2004-04-07 07:43 Marion McKelvie <marion@streamlet.co.uk>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Marion McKelvie @ 2004-04-07 07:43 UTC (permalink / raw)
To: pgsql-admin
Good idea but I'm not sure if the application will then handle the changed
column type correctly. I'll give it a go and let you know...
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Tom Lane
Sent: 07 April 2004 07:08
To: Marion McKelvie
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] restoring large objects
"Marion McKelvie" <marion@streamlet.co.uk> writes:
> Many thanks - you're right, the references are stored (by the application
> using the database) in a column of type text.
Yuck :-(. A possible solution is to dump the schema and data separately
(schema in a plain text dump, data in an -Fc or -Ft dump since plain
text doesn't support dumping LOs). Then manually edit the schema file
to change the column data type to "oid". Then load. I honestly am not
sure that this will work cleanly, but it's worth trying --- and if it
doesn't work, please let me know where it goes wrong.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: restoring large objects
@ 2004-04-07 09:28 Marion McKelvie <marion@streamlet.co.uk>
parent: Marion McKelvie <marion@streamlet.co.uk>
0 siblings, 0 replies; 6+ messages in thread
From: Marion McKelvie @ 2004-04-07 09:28 UTC (permalink / raw)
To: pgsql-admin
Good news - the restore worked fine with the new column type and the
application worked fine once I'd added a duplicate column of type text. So
at least I have a workable recovery procedure!
Many thanks for your help.
Marion
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Marion McKelvie
Sent: 07 April 2004 08:44
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] restoring large objects
Good idea but I'm not sure if the application will then handle the changed
column type correctly. I'll give it a go and let you know...
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Tom Lane
Sent: 07 April 2004 07:08
To: Marion McKelvie
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] restoring large objects
"Marion McKelvie" <marion@streamlet.co.uk> writes:
> Many thanks - you're right, the references are stored (by the application
> using the database) in a column of type text.
Yuck :-(. A possible solution is to dump the schema and data separately
(schema in a plain text dump, data in an -Fc or -Ft dump since plain
text doesn't support dumping LOs). Then manually edit the schema file
to change the column data type to "oid". Then load. I honestly am not
sure that this will work cleanly, but it's worth trying --- and if it
doesn't work, please let me know where it goes wrong.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2004-04-07 09:28 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-06 12:02 restoring large objects Marion McKelvie <marion@streamlet.co.uk>
2004-04-06 15:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-04-06 15:46 ` Marion McKelvie <marion@streamlet.co.uk>
2004-04-07 06:07 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-04-07 07:43 ` Marion McKelvie <marion@streamlet.co.uk>
2004-04-07 09:28 ` Marion McKelvie <marion@streamlet.co.uk>
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