Re: Script for reading flat file without delimiters

Поиск
Список
Период
Сортировка
От Tino Wildenhain
Тема Re: Script for reading flat file without delimiters
Дата
Msg-id 44A3E55C.7070904@wildenhain.de
обсуждение исходный текст
Ответ на Script for reading flat file without delimiters  (Mehdi Aboulkassim <mehdi10ab@yahoo.fr>)
Список pgsql-general
Mehdi Aboulkassim schrieb:
> If I had to write it in java, I wouldn't mail this issue.
>
> I somewhat a Neophyte in Postrgres that's why I need your help.
>
> I've searched in the netbut I haven't found a script in Plpgsql that can
> read a file.
> Can you tell me if we can do this in Plpgsql?

No you cant read in a file like that with psql. You cant
access filesystem with plpgsql either (quick check
in the docs would have tell you that...)

I was suggesting you write at least a converter program
in whatever language you are confortable with. May it
be java or whatever.

In that script you either access the database directly
(usual JDBC stuff) either via ordinary INSERT INTO ...
statements or if you feel desparete with COPY FROM STDIN
and then streaming.

IF thats too hard for you, just write a converter which reads
your file and outputs a regular CSV file. You can then use
psql command line tool to pull this into the database
(via its COPY function) or via backend with the COPY SQL
command.

If thats all too complex for you, I'm sorry you should stay
away from coding...

Regards
Tino Wildenhain

В списке pgsql-general по дате отправления:

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: phppgadmin
Следующее
От: "Jasbinder Bali"
Дата:
Сообщение: Database connectivity using a unix shell