so.
Insert file1.dat into a bytea field of table a.
Table a's insert trigger fires, and postgres looks at the bytea field and see's file1.dat and its contents of "1234 johnny 1254.12".
Trigger runs logic on data and loads into appropriate tables
I hope this makes sense.
Chris
On 4/11/07,
Chris Hoover <revoohc@xxxxxxxxx> wrote:
No, I need to store the entire file as received into the database.
ChrisOn 4/11/07, Alvaro Herrera < alvherre@xxxxxxxxxxxxxxxxx> 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/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support