Обсуждение: large object dump-restore problem(bug?)

Поиск
Список
Период
Сортировка

large object dump-restore problem(bug?)

От
Risko Peter
Дата:
Hello,

  I am using postgresql 7.2.1-2 on Debian (woody). Everything is fine, but
it seems to me that lo dumping/restoring (or lo_import?) is buggy:

  -with psql I import some lo into the db:
vegzes=# \lo_import /pl.sh 'alma'
lo_import 16590
vegzes=# \lo_list
    Large objects
  ID   | Description
-------+-------------
 16590 | alma
(1 row)
  -It is okay, now I dump the db, in bash:
pg_dump -o -b -u -Ft vegzes >vegzes.dump
  -It's okay, now I drop and recreate the db (bash):
dropdb -U postgres vegzes
createdb -T template0 -U postgres vegzes
  -It's ok., let me restore it (bash):
pg_restore -v -u -d vegzes vegzes.dump
User name: postgres
pg_restore: connecting to database for restore
Password:
pg_restore: implied data-only restore
pg_restore: executing <Init> Max OID
pg_restore: disabling triggers
pg_restore: restoring data for table BLOBS
pg_restore: restoring large object OID 16590
pg_restore: connecting to database vegzes as user postgres
Password:
pg_restore: creating table for large object cross-references
pg_restore: restored 1 large objects
pg_restore: enabling triggers
pg_restore: disabling triggers
pg_restore: enabling triggers
  -It's okay, let me check the db (psql):
vegzes=# \lo_list
    Large objects
  ID   | Description
-------+-------------
 16600 |

  Here is my problem. The lo I restored has a new ID, and the description
vanished. Is there a solution for this?

thanks: Peter RISKO




Re: large object dump-restore problem(bug?)

От
Tom Lane
Дата:
Risko Peter <peter@risko.hu> writes:
>   Here is my problem. The lo I restored has a new ID, and the description
> vanished. Is there a solution for this?

No, and no.  The LO *will* have a new OID; there's no alternative to
that.  pg_dump doesn't currently make any attempt to save descriptions
for large objects --- this might have something to do with the fact
that there's no official support for it (no COMMENT ON statement).
LO descriptions exist only in the mind of psql; they're a tad broken
even there, since that code doesn't work if you're not superuser.

            regards, tom lane