Powered by Blogger.

Monday, 18 August 2014

import csv data in Postgresql

By Shambhu Kumar  |  21:34 No comments

1.     Create table in postgresql
CREATE TABLE zipcodes  (
zip char(5),
city varchar,
state char(5),
latitude double precision,
longitude double precision, 
timezone varchar, dst varchar);
2.     write import statement
COPY zipcodes FROM 'C:/ZipCodes.csv' DELIMITER ',' CSV;
3.     Sample data for csv
Ø     "00210","Portsmouth","NH","43.005895","-71.013202","-5","1"
Ø     "00211","Portsmouth","NH","43.005895","-71.013202","-5","1"
Ø     "00212","Portsmouth","NH","43.005895","-71.013202","-5","1"
Ø     "00213","Portsmouth","NH","43.005895","-71.013202","-5","1"
Ø     "00214","Portsmouth","NH","43.005895","-71.013202","-5","1"
Ø     "00215","Portsmouth","NH","43.005895","-71.013202","-5","1"
Ø     "00501","Holtsville","NY","40.922326","-72.637078","-5","1"
Ø     "00544","Holtsville","NY","40.922326","-72.637078","-5","1"

Author: Shambhu Kumar

Hello, I am Author, decode to know more: In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet.

0 comments:

Recent Articles

© 2014 Learning Java. WP themonic converted by Bloggertheme9. Published By Gooyaabi Templates
TOP