Re: AW: Re: pg_dump and LOs (another proposal)

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel(dot)Janik(at)linux(dot)cz, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: AW: Re: pg_dump and LOs (another proposal)
Date: 2000-07-06 08:20:21
Message-ID: 3.0.5.32.20000706182021.024e2c20@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 09:52 6/07/00 +0200, Zeugswetter Andreas SB wrote:
>>
>> I'll also have to modify pg_restore to talk to the database
>> directly (for
>> lo import). As a result I will probably send the entire
>> script directly
>> from withing pg_restore. Do you know if comment parsing
>> ('--') is done in
>> the backend, or psql?
>
>Strictly speaking you are absolutely safe if you only do one update
>with the max oid from the 30,000 rows before you start creating the lo's.
>Don't know if you know that beforehand though.
>
>If you only know afterwards then you have to guarantee that no other
>connection to this db (actually postmaster if you need the oid's site
>unique)
>does anything while you insert the lo's and then update to max oid.
>

You may be confusing the two proposed techniques, the current flavour of
the minute is to restore the BLOBs using lo_craete to get a new oid; write
an entry in a table indicating what the old & new are, then when the table
data is loaded, update all oid fields that refer to oids in the xref table.
It's pretty nasty, but it has the big advantage of being as vanilla as
possible. It's also pretty close to what pg_dump_lo does.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-06 08:20:55 Re: Alternative new libpq interface.
Previous Message Zeugswetter Andreas SB 2000-07-06 07:52:32 AW: Re: pg_dump and LOs (another proposal)