Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BC9BF1337990 for ; Thu, 24 Mar 2011 14:00:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 08748-01 for ; Thu, 24 Mar 2011 17:00:01 +0000 (UTC) X-Greylist: delayed 00:05:10.832203 by SQLgrey-1.7.6 Received: from alexis.jtlnet.com (alexis.jtlnet.com [69.36.9.70]) by mail.postgresql.org (Postfix) with ESMTP id 6BC2713364DE for ; Thu, 24 Mar 2011 14:00:01 -0300 (ADT) Received: from dunslane.net ([::ffff:127.0.0.1]) by alexis.jtlnet.com with esmtp; Thu, 24 Mar 2011 12:55:13 -0400 id 00027C83.4D8B7771.00003BDC Received: from 208.91.122.102 (SquirrelMail authenticated user andrew@dunslane.net) by dunslane.net with HTTP; Thu, 24 Mar 2011 12:55:13 -0400 (EDT) Message-ID: <47676.208.91.122.102.1300985713.squirrel@dunslane.net> In-Reply-To: <1300985156-sup-3058@alvh.no-ip.org> References: <690867AB-C50B-4354-91D0-8A0811639C4C@gmail.com> <4D879CD0.5030803@dunslane.net> <3EF9E4CC-CF42-4B45-86FF-4CB9D46D7442@gmail.com> <4D8AF8C2.3000007@lelarge.info> <4ACC318A-1B6F-49A5-9B02-49EEAF7B97C7@gmail.com> <1300985156-sup-3058@alvh.no-ip.org> Date: Thu, 24 Mar 2011 12:55:13 -0400 (EDT) Subject: Re: foreign data wrappers From: "Andrew Dunstan" To: "Alvaro Herrera" Cc: "Zheng Yang" , "Guillaume Lelarge" , "Selena Deckelmann" , "Andrew Dunstan" , "pgsql-students" User-Agent: SquirrelMail/1.4.10a Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) Importance: Normal X-Mime-Autoconverted: from 8bit to 7bit by courier 0.64 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201103/23 X-Sequence-Number: 164 On Thu, March 24, 2011 12:49 pm, Alvaro Herrera wrote: > Excerpts from Zheng Yang's message of jue mar 24 05:49:19 -0300 2011: > >> I am quite new to postgresql, but slowly picking up :) In general >> context, storing images directly inside DBMS fields as BLOBs was not >> considered as a good practice. >> However, storing file directories or links may cause inconsistency. So >> I am quite interested in how this datalink concept can be implemented! > > I'm not really sure how different would be handling the file linking in > an FDW. For example, if a transaction runs that deletes a file through > the FDW, and the transaction rolls back, how are you going to restore > the file to life? > > (It sounds like you're trying to have a FDW that would present a > directory as a table, and each file in the dir as a row. Maybe it's not > a bad idea but it needs a lot more thought.) > Currently FDWs can't store anything. They are read-only. But I don't really buy this stuff about not storing images in the database. I've done numbers of apps that do exactly that with great success. If the images are huge that's another matter, but for small images it works just fine. cheers andrew