Re: Assistance in importing a csv file into Postgresql
Вложения
В списке pgsql-general по дате отправления:
| От | Stephen Frost |
|---|---|
| Тема | Re: Assistance in importing a csv file into Postgresql |
| Дата | |
| Msg-id | 20090525151207.GR8123@tamriel.snowman.net обсуждение исходный текст |
| Ответ на | Assistance in importing a csv file into Postgresql (Intengu Technologies <sindile.bidla@gmail.com>) |
| Ответы |
Re: Assistance in importing a csv file into Postgresql
Re: Assistance in importing a csv file into Postgresql |
| Список | pgsql-general |
Greetings,
* Intengu Technologies (sindile.bidla@gmail.com) wrote:
> What I would like to do is
>
> If field1=1 make table1 and insert the rest of field1=1 into this table
> If field1=2 make table2 and insert the rest of field1=2 into this table
>
> Hence in this example one will have table1, table2, table3, table4,
> table5 and table6
>
> How can I accomplish this using the COPY command.
This currently can't be done with the COPY command directly. There are
a couple of options:
#1- Have a single table with a trigger on it that does this for you
#2- Write a simple perl script which does this for you
#3- Load the data into one table and then use SQL to move it to the
other tables (which you would need to create first)
Enjoy,
Stephen
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера