From efd61f205a3d384a83a4de48c286b86131a241cd Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 11 Oct 2017 11:59:52 -0400 Subject: [PATCH] add COPY component --- srce.pgsql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/srce.pgsql b/srce.pgsql index 8af1773..4f49fdb 100644 --- a/srce.pgsql +++ b/srce.pgsql @@ -65,7 +65,7 @@ begin ----------------------------------------------------add create table verbage in front of column list-------------------------------------------------------- _t := format('CREATE TEMP TABLE csv_i (%s)', _t); - --raise notice '%', _t; + raise notice '%', _t; ----------------------------------------------------build the table----------------------------------------------------------------------------------------- @@ -77,4 +77,8 @@ begin end $$; -SELECT * FROM csv_i; \ No newline at end of file +--SELECT * FROM csv_i; + +COPY csv_i FROM 'C:\Users\ptrowbridge\downloads\transsearchcsv.csv' WITH (HEADER TRUE,DELIMITER ',', FORMAT CSV, ENCODING 'SQL_ASCII',QUOTE '"'); + +SELECT row_to_json(csv_i) FROM csv_i; \ No newline at end of file