pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Chris Ruprecht <chrup999@yahoo.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: PL/PGSQL and external (flat ASCII) files - Urgent ...	:)
Date: Tue, 17 Jul 2001 16:31:41 -0700
Message-ID: <web-87103@davinci.ethosmedia.com> (raw)
In-Reply-To: <B77A2A2C.2466%chrup999@yahoo.com>

Chris,

Hmmph.  People are in a bad mood this week; obviously few other people
on the list have had to write applications for the banking industry,
which trades everything in flat files.  Give Chris a break!

> >From an input file where the records looks like this one:
> 
> 020-13 016-05 07-15-2001 23:59:07 00:00:59   09678634321208
> 78634321208
>              0000005300                 ^M

The answer to your question is somewhat annoying, though:  You can't use
PL/pgSQL for this task.  Basically, two other PostgreSQL function
languages - PL/tcl and PL/perl - have excellent text-parsing ability.
As such, there is no movement affort to replicate that functionality in
PL/pgSQL.

So:  Hire yourself a perl or tcl hacker.  Have them write parsing
functions in pl/tclU or pl/perl to load the records.  Then have your
PL/pgSQL function call the tcl or perl functions.

You'll need to get advice from other list members or the docs (and don't
forget the "non-FAQ Documentation" page!)  on how to use these other
languages, as I have had no need for them, to date.

-Josh



______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



view thread (10+ messages)  latest in thread

Message-ID: <web-87103@davinci.ethosmedia.com>
Permalink:  ../web-87103@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-87103@davinci.ethosmedia.com

 · 

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: josh@agliodbs.com, chrup999@yahoo.com
  Subject: Re: PL/PGSQL and external (flat ASCII) files - Urgent ...	:)
  In-Reply-To: <web-87103@davinci.ethosmedia.com>

* 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