Giuseppe, am Mon, Jan 31, 2011 at 11:24:24AM +0100 hast du folgendes geschrieben: > let's recap what I did. I have an application (DMS) that store images as > large objects into the database. All tables used by the application are > inside a single schema. A database usually host many application > instances in many different schemas. (So, as I now understand, all large > objects are mixed together into the same pg_public schema.) > > Now, I tried to move one application instance from one database in lenny > to one database in squeeze. So, I exported the complete database with > pg_dump and imported only one schema using pg_restore with option > --schema. > > The resulted database have all tables, all records, but no large > objects. > > You say this is not a bug of pg_restore, I think it is. Anyway, could > you tell me how I should have done such migration?
blobs are a contributed module and not part of pgsql proper. It's not a bug that was caused by upgrading the package, but instead you did a manual copy. Normally folks copy a whole database. If you restrict your import, you have to make sure that all relevant data is copied. If you don't copy all relevant data, you lose. I don't say it's not a bug, I just say it's wishlist. It's a missing feature of pg_restore to detect a contributed module in use and warn that data in another schema is indirectly referenced. You need to install the lo module by manual action. The documentation even says this: "This appendix contains information regarding the modules that can be found in the contrib directory of the PostgreSQL distribution. These include porting tools, analysis utilities, and plug-in features that are not part of the core PostgreSQL system, mainly because they address a limited audience or are too experimental to be part of the main source tree. This does not preclude their usefulness." That said: I don't think there's a sane way to extract blobs of different schemas just using pg_dump and pg_restore. You either restore pg_catalog along with the schema you want or you import the whole database and drop superfluous schemas. You can also actually *look* at the dump and look for the blobs and add the part that's needed to the database afterwards. The bug should also be filed upstream. Please note: I'm not the maintainer of the package. However, as this was filed at RC severity, I had a look. And it's not RC. Kind regards Philipp Kern
signature.asc
Description: Digital signature

