inserting records from a file

Поиск
Список
Период
Сортировка
Искать

inserting records from a file

От:
"Kelly" <finncr4@comcast.net>
Дата:

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

Re: inserting records from a file

От:
Joe Conway <mail@joeconway.com>
Дата:
Kelly wrote:
> 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.
> 

See:
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=sql-copy.html

HTH,

Joe


Re: inserting records from a file

От:
"paul butler" <paul@entropia.co.uk>
Дата:
Send reply to:  	
From:           	"Kelly" 
To:             	
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


FAQ