[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    [GENERAL] Re: Importing into Postgres from a csv file
From:       "Zorlac" <zorlac () planetibiz ! com>
Date:       2000-08-30 20:56:40
[Download RAW message or body]

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
>
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic