Copying large object in a stored procedure - Mailing list pgsql-general

From Csaba Nagy
Subject Copying large object in a stored procedure
Date
Msg-id 1208259052.8259.329.camel@PCD12478
Whole thread Raw
Responses Re: Copying large object in a stored procedure
List pgsql-general
Hi all,

Is there an easy way to copy a large object to a new one, having a new
OID and it's content independent from the original ?

The large object API functions would only allow to stream the original
to the client and stream it back to the server for the copy, which is
not really optimal... I would like to do it all on the server side. The
server side functions would work to export the original to a file and
then import it again, but that needs superuser privileges which rules
that out.

I could simply copy the contents of the pg_largeobject table, but then I
need  a new OID for that. I can use the server side large object API to
create an empty large object, delete it, then use the obtained OID for
the copy... but that also sounds somewhat suboptimal.

Is there any simple way to copy a large object ?

Cheers,
Csaba.




pgsql-general by date:

Previous
From: Klint Gore
Date:
Subject: Re: COPY to STDOUT and pipes
Next
From: Karsten Hilbert
Date:
Subject: Re: Storage sizes for dates/times (documentation bug?)