Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :) - Mailing list pgsql-sql

From Tom Lane
Subject Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :)
Date
Msg-id 26545.995404013@sss.pgh.pa.us
Whole thread Raw
In response to PL/PGSQL and external (flat ASCII) files - Urgent ... :)  ("Chris Ruprecht" <chrup999@yahoo.com>)
Responses Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :)  (Chris Ruprecht <chrup999@yahoo.com>)
List pgsql-sql
"Chris Ruprecht" <chrup999@yahoo.com> writes:
> I need to know how I can access a flat file from within a PL/PGSQL script.

You can't --- and you should ask yourself hard questions about why your
system design needs that, or whether the data in question shouldn't be
inside the database to begin with.  Among other problems, data in a flat
file will not be under transactional control.  That could cause such
interesting problems as a transaction that logically precedes another
one being able to see a later version of the flat file than the "later"
transaction sees.

If you are absolutely intent on doing this, you could use a function
coded in C or in pltclu (unsecured pltcl).  But there's no feature in
plpgsql to do it, and requests for one are not likely to meet with much
favor.
        regards, tom lane


pgsql-sql by date:

Previous
From: Wei Weng
Date:
Subject: Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :)
Next
From: Peter Eisentraut
Date:
Subject: Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :)