Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 722F89FB483 for ; Wed, 11 Apr 2007 10:18:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 25761-02 for ; Wed, 11 Apr 2007 10:17:53 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by postgresql.org (Postfix) with ESMTP id 8BB719FA31B for ; Wed, 11 Apr 2007 10:17:58 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c24so190696ana for ; Wed, 11 Apr 2007 06:17:57 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=I9QeilABGCBcSJP9NpLUTNAQ651UEzR/zhOEHaJqJzmGZiC84UxjhhyZKzEXymC5hhFJ7/QlodVf4DTAvoP8S11r8B9DSRYOZ1fGsS+z4kM1CLpOt8vAI2O0XarmcPRyAwQV2bx9mDheQpFdX171QbJwlGxkjURH/kfg9vVonMI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=H3mnKKvFA4xrbHpzpBa0SoLYn5h9UIkkRgD7xQkP7kCSF5Hz51ez4urj91HwD8PkWte8iv8ntDoT3vZMnHjUY5H0iEhBC9iwRR5+di64sXcGSQ8M5wv1TIPMIjACR4LAo68QTVWUuuM8eM7KlR4HYfHafhkH6cYHWMmVfwmcwug= Received: by 10.100.138.2 with SMTP id l2mr388511and.1176297477162; Wed, 11 Apr 2007 06:17:57 -0700 (PDT) Received: by 10.100.165.19 with HTTP; Wed, 11 Apr 2007 06:17:56 -0700 (PDT) Message-ID: <1d219a6f0704110617y31780a75q8f783893acb6ef07@mail.gmail.com> Date: Wed, 11 Apr 2007 09:17:56 -0400 From: "Chris Hoover" To: "Chris Hoover" , "pgsql-admin@postgresql.org" Subject: Re: Bytea question In-Reply-To: <20070411130904.GD4896@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6454_14671426.1176297476981" References: <1d219a6f0704110602n5b9fe58dy34e05008b9bff0be@mail.gmail.com> <20070411130904.GD4896@alvh.no-ip.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/96 X-Sequence-Number: 25160 ------=_Part_6454_14671426.1176297476981 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline No, I need to store the entire file as received into the database. Chris On 4/11/07, Alvaro Herrera wrote: > > Chris Hoover escribi=F3: > > 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/ > PostgreSQL Replication, Consulting, Custom Development, 24x7 support > ------=_Part_6454_14671426.1176297476981 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline No, I need to store the entire file as received into the database.

C= hris

On 4/11/07, Alvaro Herrera < alvherre@commandprompt.com> wrote:
Chris Hoover escribi=F3:
> 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 &quo= t;store a file", do you mean "store a filename"?

> Here is my scenario:
>
> Receive text file
> insert = file into bytea field
> insert trigger fires
>  - rea= d 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&= nbsp;           &nbs= p;            &= nbsp;      http://www.CommandPrompt.com/
PostgreSQL Replication, Consul= ting, Custom Development, 24x7 support

------=_Part_6454_14671426.1176297476981--