X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 9B3E99FA0EF for ; Mon, 11 Sep 2006 07:15:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 36365-02 for ; Mon, 11 Sep 2006 10:15:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.192]) by postgresql.org (Postfix) with ESMTP id D0E249FB209 for ; Mon, 11 Sep 2006 07:15:27 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id 14so430948nzn for ; Mon, 11 Sep 2006 03:15:26 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=sDyVZQdA10bB0OEBJ7sjgh2VbdjR0UfL7kx5b5BHxSR/Oo4w+RGOZ8oqQGgrHYLQsr75maouEL6NQKb8yQhyNroMgZvOn82twOPlYebyYQmfk9exMnMCnXJq0lv2SDmktgb0uAJfbku8xUQFHKXsLXkLIIVYDjzdKszIIqAeqSI= Received: by 10.64.28.18 with SMTP id b18mr5183413qbb; Mon, 11 Sep 2006 03:15:26 -0700 (PDT) Received: by 10.65.192.4 with HTTP; Mon, 11 Sep 2006 03:15:26 -0700 (PDT) Message-ID: <3650d0d50609110315uff51429n48e038dc6b9a482e@mail.gmail.com> Date: Mon, 11 Sep 2006 15:45:26 +0530 From: "Purusothaman A" To: "Martijn van Oosterhout" , "Purusothaman A" , "Milen A. Radev" , pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: Re: [GENERAL] Problem with lo_export() and lo_import() from remote machine. In-Reply-To: <20060911100336.GB16564@svana.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_132965_30708878.1157969726386" References: <3650d0d50609090407j237bb710h9bde1675c773925d@mail.gmail.com> <3650d0d50609090449q2aec1098xc3b62dd169de5843@mail.gmail.com> <20060909120613.GA10336@svana.org> <3650d0d50609110215j7361bc2dj55e6d7d73af1d07d@mail.gmail.com> <20060911093819.GA15769@svana.org> <3650d0d50609110257m7b216b27nabb8ae87f7852e2@mail.gmail.com> <20060911100336.GB16564@svana.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/86 X-Sequence-Number: 23000 ------=_Part_132965_30708878.1157969726386 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Martijn van Oosterhout and Marco Bizzarri. But, according to syntax of client side lo_import and lo_export, we should have 2 variable PGconn (for esatablished connection) and lobjld (imported file ID in PostgreSQL). I don't know how to do this in SQL statements. pls give me sample client side sql statements. :) Purusothaman A On 9/11/06, Martijn van Oosterhout wrote: > > On Mon, Sep 11, 2006 at 03:27:09PM +0530, Purusothaman A wrote: > > Thanks Martijn van Oosterhout, > > > > So, I have to write my own wrapper function upon the functions below. > > 1. Oid lo_import(PGconn *conn, const char *filename); > > 2. int lo_export(PGconn *conn, Oid lobjId, const char *filename); > > Not sure why you need a wrapper (you didn't say which language you were > using) but those functions work exactly like the version you put in the > SQL statements, except the filenames are for the client computer with > client permissions. > > Hope this helps, > -- > Martijn van Oosterhout http://svana.org/kleptog/ > > From each according to his ability. To each according to his ability to > litigate. > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQFFBTR4IB7bNG8LQkwRAvhPAJ9KHp9DO1EjPqbkGwBdaSaKx5J90wCfQtZ8 > ijq1n/SgAlwIiEgDI6zfICg= > =Xk7N > -----END PGP SIGNATURE----- > > > ------=_Part_132965_30708878.1157969726386 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Martijn van Oosterhout and Marco Bizzarri.

But, according to syntax of client side lo_import and lo_export, we should have 2 variable PGconn (for esatablished connection) and lobjld (imported file ID in PostgreSQL).

I don't know how to do this in SQL statements.

pls give me sample client side sql statements.

:)
Purusothaman A

On 9/11/06, Martijn van Oosterhout <kleptog@svana.org> wrote:
On Mon, Sep 11, 2006 at 03:27:09PM +0530, Purusothaman A wrote:
> Thanks Martijn van Oosterhout,
>
> So, I have to write my own wrapper function upon the functions below.
>   1. Oid lo_import(PGconn *conn, const char *filename);
>   2. int lo_export(PGconn *conn, Oid lobjId, const char *filename);

Not sure why you need a wrapper (you didn't say which language you were
using) but those functions work exactly like the version you put in the
SQL statements, except the filenames are for the client computer with
client permissions.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFBTR4IB7bNG8LQkwRAvhPAJ9KHp9DO1EjPqbkGwBdaSaKx5J90wCfQtZ8
ijq1n/SgAlwIiEgDI6zfICg=
=Xk7N
-----END PGP SIGNATURE-----



------=_Part_132965_30708878.1157969726386--