Re: Importing into Postgres from a csv file

Поиск
Список
Период
Сортировка
От Zorlac
Тема Re: Importing into Postgres from a csv file
Дата
Msg-id cyer5.15829$pu4.1135151@typhoon.ne.mediaone.net
обсуждение исходный текст
Ответ на Importing into Postgres from a csv file  ("Jake" <ccrasoro@home.com>)
Список pgsql-general
You sure can...

put the file somewhere on your db server.. let's just say /tmp and the file
is called data.db

su - postgres
psql [dbname]
copy TABLE from '/tmp/data.db' using delimiters ',';

That'll do ya.. Make sure that the columns are in the right order too... :)

Here's the syntax for the copy command

COPY [ BINARY ] table [ WITH OIDS ]
    FROM { 'filename' | stdin }
    [ [USING] DELIMITERS 'delimiter' ]
    [ WITH NULL AS 'null string' ]
COPY [ BINARY ] table [ WITH OIDS ]
    TO { 'filename' | stdout }
    [ [USING] DELIMITERS 'delimiter' ]
    [ WITH NULL AS 'null string' ]



Jake <ccrasoro@home.com> wrote in message
news:y%Vo5.24467$eR5.721567@news1.rdc1.on.wave.home.com...
> Does any one know if this is possible, and if so how?
>
>
> Jake
>
>



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

Предыдущее
От: Zeljko Trogrlic
Дата:
Сообщение: Column name case conversion
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [Solved] SQL Server to PostgreSQL