From: | "Josh Berkus" <josh(at)agliodbs(dot)com> |
---|---|
To: | Chris Ruprecht <chrup999(at)yahoo(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :) |
Date: | 2001-07-17 23:31:41 |
Message-ID: | web-87103@davinci.ethosmedia.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Ruprecht | 2001-07-18 00:01:57 | Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :) |
Previous Message | Tom Lane | 2001-07-17 23:19:44 | Re: PL/PGSQL and external (flat ASCII) files - Urgent ... :) |