Re: Copy entire file as one field

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: Copy entire file as one field
Дата
Msg-id 1038953001.1419.1.camel@linda.lfix.co.uk
обсуждение исходный текст
Ответ на Re: Copy entire file as one field  ("Warren Massengill" <warrenmassengill@hotmail.com>)
Список pgsql-novice
On Tue, 2002-12-03 at 19:48, Warren Massengill wrote:
> My database is pg, the table is mail.
> The small text files are in /home/kelly/message/.
> The bash shell script is merge.
>
> Somehow I failed to translate your instructions...
>
> -----------------------------------------------------
> #!/bin/bash
>
> for f in `ls /home/kelly/message*`
                               ^^^^^^
                           message/*

> do
>         psql -d pg -c "INSERT INTO mail (message)
>                                  VALUES ('`cat $f`')"
> done

Your files are in that directory, so the wild card must be too.
--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "What shall we then say to these things? If God be for
      us, who can be against us?"              Romans 8:31


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

Предыдущее
От: "John Sklavounos"
Дата:
Сообщение: Help! Lost functions
Следующее
От: "Devinder K Rajput"
Дата:
Сообщение: Re: Copy entire file as one field