| From: | "paul butler" <paul(at)entropia(dot)co(dot)uk> | 
|---|---|
| To: | "Kelly" <finncr4(at)comcast(dot)net> | 
| Cc: | pgsql-novice(at)postgresql(dot)org | 
| Subject: | Re: inserting records from a file | 
| Date: | 2003-08-31 07:13:46 | 
| Message-ID: | 3F51AE3A.31123.210109@localhost | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
Send reply to:  	<finncr4(at)comcast(dot)net>
From:           	"Kelly" <finncr4(at)comcast(dot)net>
To:             	<pgsql-novice(at)postgresql(dot)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(at)postgresql(dot)org so that your
>       message can get through to the mailing list cleanly
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Luis H | 2003-08-31 22:16:34 | Re: Can Postgresql run in MS Windows | 
| Previous Message | Joe Conway | 2003-08-31 04:06:44 | Re: inserting records from a file |