Re: Import textfile as table

From: Michelle Konzack <linux(dot)mailinglists(at)freenet(dot)de>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Cc: shridhar_daithankar(at)persistent(dot)co(dot)in, <nandrews(at)investsystems(dot)co(dot)uk>
Subject: Re: Import textfile as table
Date: 2002-10-06 15:40:39
Message-ID: 3.0.6.16.20021006174039.51ff484c@pop3.01019freenet.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

if you seed it sometimes... thanks to 'rovero'

>Run psql......
>create table table_name.........
>copy table_name from '/full/path/to/file' using delimiters '\t';

Michelle

Am 15:34 2002-10-03 +0530 hat Shridhar Daithankar geschrieben:
>
>On 2 Oct 2002 at 18:01, Michelle Konzack wrote:
>
>> Hello,
>>
>> I have gotten a 16 MByte textfile with around 27.000 lines of data
>> which contains a database with 22 fields which are <TAB> seperated.
>>
>> How can I import it into a (new) table and or new
>> database of pgsql.
>
>You can use \copy in psql. I don't know how would you specify tab as delimeter.
>May be you should convert it to some other delimeter like ':' or ',' if tab
>does not work.
>
>Get a small chunk of that file. First 100 records or so and experiment.
>Otherwise it might get quite irritating..;-)
>
>
>Bye
> Shridhar
>
>--
>White's Statement: Don't lose heart!Owen's Commentary on White's Statement:
>...they might want to cut it out...Byrd's Addition to Owen's Commentary: ...and
>they want to avoid a lengthy search.
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>
> ########## Get the Power of Debian/GNU-Linux ##########

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Curt Sampson 2002-10-06 15:52:24 Re: [HACKERS] Performance while loading data and indexing
Previous Message Christoph Strebin 2002-10-06 15:24:32 Case insensitive columns