Re: Import csv file into multiple tables in Postgres

Поиск
Список
Период
Сортировка
От Todd Lewis
Тема Re: Import csv file into multiple tables in Postgres
Дата
Msg-id 4223C1F1.24272.15046213@localhost
обсуждение исходный текст
Ответ на Re: Import csv file into multiple tables in Postgres  (Andrew Hammond <ahammond@ca.afilias.info>)
Список pgsql-novice
Standard method is to copy into an interface table. Once the data is
loaded into the interface you can them import it into the tables that
you want.

If this is a process that is run several times, then perl could be
used to script your import into an interface table and then
subsequently moving the data to the tables you want.


> The brief answer is no, you can not import from a single csv file into
> multiple tables.
>
> If the csv file consists of two distinct sections of data, then you
> could of course split it into two csv files. If what you want to do is
> normalize existing data, then you should first import the existing data
> into a working table. Then you can manipulate it within the database.
>
> It is unlikely that you will need perl to do any of this.
>
> Please post a sample of the data and the schema into which you plan to
> import your data.
>
> Drew
>
>
> Deepblues wrote:
> > Hi,
> >
> >    Is it possible to import data from a csv file into multiple tables
> > in postgresql database.
> > suppose if I have 2 tables students and departments. And my csv file
> > contains data for both the tables. Can I import this data into the two
> > tables.
> >
> > Is there any perl script available to do this.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



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

Предыдущее
От: "Ross Gohlke"
Дата:
Сообщение: Re: Using upper() / decode() together
Следующее
От: "Christian Hofmann"
Дата:
Сообщение: Anyarray with mixed data types inside of a PL/PLSQL function parameter