From 1882f46e5f32202fe927632999999d052dd3aa3a Mon Sep 17 00:00:00 2001 From: Jason Hopper Date: Wed, 21 Aug 2024 12:58:24 -0300 Subject: [PATCH 1/2] fixing quote character not being excaped and replacing server side COPY with client side version --- scripts/make_bulk_data.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/make_bulk_data.sh b/scripts/make_bulk_data.sh index 43c5d3246..749ed1145 100755 --- a/scripts/make_bulk_data.sh +++ b/scripts/make_bulk_data.sh @@ -337,7 +337,7 @@ echo "Streaming ${lst[0]} to S3" psql \ --command \ "set statement_timeout to 0; - COPY ${lst[0]} ${lst[1]} TO STDOUT WITH (FORMAT csv, ENCODING utf8, HEADER, QUOTE \"\`\", FORCE_QUOTE *)" \ + \COPY ${lst[0]} ${lst[1]} TO STDOUT WITH (FORMAT csv, ENCODING utf8, HEADER, QUOTE \"\`\", FORCE_QUOTE *)" \ --quiet \ --host "$DB_HOST" \ --username "$DB_USER" \ @@ -418,7 +418,7 @@ declare -a lst="$group" cat >> "$OUT" <<- EOF echo "Loading ${lst[2]} to database" psql --command \ -"COPY public.${lst[0]} ${lst[1]} FROM '\$BULK_DIR/${lst[2]}' WITH (FORMAT csv, ENCODING utf8, QUOTE \'\`\', HEADER)" \ +"\COPY public.${lst[0]} ${lst[1]} FROM '\$BULK_DIR/${lst[2]}' WITH (FORMAT csv, ENCODING utf8, QUOTE \'\`\', HEADER)" \ --host "\$BULK_DB_HOST" \ --username "\$BULK_DB_USER" \ --dbname "\$BULK_DB_NAME" From a711a14a62f35727177c2942d12210ffb497a82e Mon Sep 17 00:00:00 2001 From: Jason Hopper Date: Wed, 21 Aug 2024 13:03:56 -0300 Subject: [PATCH 2/2] reverting COPY change on the data export command as it is run server side --- scripts/make_bulk_data.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_bulk_data.sh b/scripts/make_bulk_data.sh index 749ed1145..d28b7a73b 100755 --- a/scripts/make_bulk_data.sh +++ b/scripts/make_bulk_data.sh @@ -337,7 +337,7 @@ echo "Streaming ${lst[0]} to S3" psql \ --command \ "set statement_timeout to 0; - \COPY ${lst[0]} ${lst[1]} TO STDOUT WITH (FORMAT csv, ENCODING utf8, HEADER, QUOTE \"\`\", FORCE_QUOTE *)" \ + COPY ${lst[0]} ${lst[1]} TO STDOUT WITH (FORMAT csv, ENCODING utf8, HEADER, QUOTE \"\`\", FORCE_QUOTE *)" \ --quiet \ --host "$DB_HOST" \ --username "$DB_USER" \