Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 717C8632C44 for ; Mon, 2 Feb 2009 10:13:12 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81231-03 for ; Mon, 2 Feb 2009 10:13:09 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mirapoint3.brutele.be (mirapoint3.brutele.be [212.68.199.148]) by mail.postgresql.org (Postfix) with ESMTP id 37F75632C3F for ; Mon, 2 Feb 2009 10:13:08 -0400 (AST) Received: from abraham.pivert.org (user-85-201-95-140.static.tvcablenet.be [85.201.95.140] (may be forged)) by mirapoint3.brutele.be (MOS 3.8.7a) with ESMTP id AUA76301; Mon, 2 Feb 2009 15:12:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by abraham.pivert.org (Postfix) with ESMTP id 40D061DC3C for ; Mon, 2 Feb 2009 15:13:05 +0100 (CET) X-Virus-Scanned: amavisd-new at appart.pivert.org Received: from abraham.pivert.org ([127.0.0.1]) by localhost (mail.pivert.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1m9ZESMV4n4L for ; Mon, 2 Feb 2009 15:13:04 +0100 (CET) Received: from bart.localnet (unknown [192.168.232.34]) by abraham.pivert.org (Postfix) with ESMTP id B57321D25E for ; Mon, 2 Feb 2009 15:13:04 +0100 (CET) From: =?iso-8859-2?q?Fran=E7ois_Delpierre?= To: pgsql-php@postgresql.org Subject: Re: How to store files into the DB with PHP. (bytea ?) Date: Mon, 2 Feb 2009 15:13:10 +0100 User-Agent: KMail/1.11.0 (Linux/2.6.27-11-generic; KDE/4.2.0; i686; ; ) References: <200902021102.06157.pgsql@pivert.org> <200902021355.35100.pgsql@pivert.org> <5713.193.179.187.70.1233580658.squirrel@sq.gransy.com> In-Reply-To: <5713.193.179.187.70.1233580658.squirrel@sq.gransy.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200902021513.11175.pgsql@pivert.org> X-Junkmail-Status: score=10/50, host=mirapoint3.brutele.be X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A090206.4986FF73.015F,ss=1,fgs=0, ip=85.201.95.140, so=2008-05-01 23:44:25, dmn=5.7.1/2008-09-02 X-Junkmail-IWF: false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/5 X-Sequence-Number: 3981 On Monday 02 February 2009 14:17:38 tv@fuzzy.cz wrote: > > But I am just guessing - about a month ago I wrote an article about ways > to store files in a PostgreSQL database: > > http://www.fuzzy.cz/en/articles/storing-files-in-a-postgresql-database/ > > The site is still under construction, so a lot of stuff is missing there > (sorry), but the last section might give you a hint how to mimic LOBs, get > rid of some of the BYTEA / LOB disadvantages. Thanks for this address, this clearly expose the problem. It looks like the= re=20 is no perfect solution. As I can live with a file size limit of 15Mo for a= =20 memory_limit of 64Mo in PHP, I'll certainly go to BYTEA. Anyway, if I use=20 stored procedures to enforce security, the PHP pg_lo_xxx functions will be= =20 useless. Thanks a lot, =46ran=E7ois Delpierre