Re: inserting records from a file - Mailing list pgsql-novice

From paul butler
Subject Re: inserting records from a file
Date
Msg-id 3F51AE3A.31123.210109@localhost
Whole thread Raw
In response to inserting records from a file  ("Kelly" <finncr4@comcast.net>)
List pgsql-novice
Send reply to:      <finncr4@comcast.net>
From:               "Kelly" <finncr4@comcast.net>
To:                 <pgsql-novice@postgresql.org>
Subject:            [NOVICE] inserting records from a file
Date sent:          Sat, 30 Aug 2003 20:55:43 -0700

>
> I need to add a large number(1000) records to my table. How would I do this
> using a file? Any help is greatly appreciated.
>
> Kelly
Assumming its a csv file (though you can use tabs/pipes etc as delimiters:
Using psql


copy TargetTable from 'YourFileAndPath' using delimiters '\,';

more info at

http://www.postgresql.org/docs/7.3/static/sql-copy.html

and

http://www.postgresql.org/docs/7.3/static/app-psql.html

The latter concerns psql's \copy command, used if permissions are a problem.

Hope this helps

Paul Butler
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly



pgsql-novice by date:

Previous
From: Joe Conway
Date:
Subject: Re: inserting records from a file
Next
From: chrizkoh@yahoo.com (Christopher Koh)
Date:
Subject: Can Postgresql run in MS Windows