Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id E3D5E9FB86A for ; Wed, 11 Apr 2007 10:23:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 48370-04-4 for ; Wed, 11 Apr 2007 10:23:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 7409B9FB846 for ; Wed, 11 Apr 2007 10:23:11 -0300 (ADT) Received: from perhan.alvh.no-ip.org (201-221-221-161.bk12-dsl.surnet.cl [201.221.221.161]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l3BDN00M032321; Wed, 11 Apr 2007 06:23:01 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 4E5DD329F4; Wed, 11 Apr 2007 09:22:58 -0400 (CLT) Date: Wed, 11 Apr 2007 09:22:58 -0400 From: Alvaro Herrera To: Chris Hoover Cc: "pgsql-admin@postgresql.org" Subject: Re: Bytea question Message-ID: <20070411132258.GF4896@alvh.no-ip.org> Mail-Followup-To: Chris Hoover , "pgsql-admin@postgresql.org" References: <1d219a6f0704110602n5b9fe58dy34e05008b9bff0be@mail.gmail.com> <20070411130904.GD4896@alvh.no-ip.org> <1d219a6f0704110617y31780a75q8f783893acb6ef07@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1d219a6f0704110617y31780a75q8f783893acb6ef07@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Wed, 11 Apr 2007 06:23:01 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/97 X-Sequence-Number: 25161 Chris Hoover escribió: > No, I need to store the entire file as received into the database. Then you original question does not make any sense to me, because if you pass the entire file content, why would Postgres *not* be able to read it? > On 4/11/07, Alvaro Herrera wrote: > > > >Chris Hoover escribió: > >> Hopefully a quick question. > >> > >> If I store a file into a bytea field, is there anyway for postgres to > >read > >> the contents of the file? > > > >When you say "store a file", do you mean "store a filename"? > > > >> Here is my scenario: > >> > >> Receive text file > >> insert file into bytea field > >> insert trigger fires > >> - read file contents > >> - post contents into production tables > >> > >> Is this at all possible, or am I going to need to store the original > >file > >> and store/pass the file contents? -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.