X-Original-To: pgsql-interfaces@postgresql.org Received: from pd3mo2so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by postgresql.org (Postfix) with ESMTP id 47825475FD5 for ; Fri, 21 Mar 2003 17:29:47 -0500 (EST) Received: from pd4mr3so.prod.shaw.ca (pd4mr3so-qfe3.prod.shaw.ca [10.0.141.214]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0HC400B87EHOIA@l-daemon> for pgsql-interfaces@postgresql.org; Fri, 21 Mar 2003 15:29:48 -0700 (MST) Received: from pn2ml5so.prod.shaw.ca (pn2ml5so-qfe0.prod.shaw.ca [10.0.121.149]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.6 (built Apr 26 2002)) with ESMTP id <0HC40060AEHOOD@l-daemon> for pgsql-interfaces@postgresql.org; Fri, 21 Mar 2003 15:29:48 -0700 (MST) Received: from power ([24.80.229.122]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0HC4003GSEHNJF@l-daemon> for pgsql-interfaces@postgresql.org; Fri, 21 Mar 2003 15:29:48 -0700 (MST) Date: Fri, 21 Mar 2003 14:42:07 -0800 From: Daniel Bruce Lynes Subject: Re: Handling Blobs with libpq In-reply-to: <41AAAA03-5ABA-11D7-8432-000A27AFF5D2@noos.fr> To: pgsql-interfaces@postgresql.org Message-id: <200303211442.07705.dlynes@shaw.ca> MIME-version: 1.0 X-Mailer: KMail [version 1.4] Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable References: <41AAAA03-5ABA-11D7-8432-000A27AFF5D2@noos.fr> X-Archive-Number: 200303/121 X-Sequence-Number: 3870 On Thursday 20 March 2003 01:56, St=E9phane Pinel wrote: > My main need is storing pictures (like Jpegs etc) or small blobs. Doc > says that (2) is more > appropriate but I need to work with blobs in memory, not from files. If you need to work with it in memory, you're better off using the bytea (s= ame=20 thing as a varbinary). LOBs are generally for when the data is so large th= at=20 the performance of your application would be comprimised if you allocated= =20 memory for the contents. LOBs allow you to do streaming so that you don't= =20 need to allocate memory. Only the lo_export/lo_import functions require a= =20 file. All of the other LOB functions only require a stream that's chunked= =20 into byte arrays.