pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris Ruprecht <chrup999@yahoo.com>
Cc: p-sql <pgsql-sql@postgresql.org>
Subject: Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :)
Date: Tue, 17 Jul 2001 17:06:53 -0400
Message-ID: <26545.995404013@sss.pgh.pa.us> (raw)
In-Reply-To: <015e01c10eff$0ea18400$5dd26383@corp.compucom.com>
References: <015e01c10eff$0ea18400$5dd26383@corp.compucom.com>

"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



view thread (10+ messages)  latest in thread

Message-ID: <26545.995404013@sss.pgh.pa.us>
Permalink:  ../26545.995404013@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26545.995404013@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chrup999@yahoo.com
  Subject: Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :)
  In-Reply-To: <26545.995404013@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox