• Home
  • Services
    • HR Services
      • HR Advisory Services
      • Contract Staffing
      • HR Outsourcing Services
      • Manpower Supply Services
      • Payroll Processing
      • Permanent Placement
      • Recruitment and Placement Services
      • Recruitment Process Outsourcing
      • Staffing Agency Services
    • DBA Support
      • DBA Consultancy Services
      • PostgreSQL Support
    • Website Maintenance
    • CoWorking/Virtual Office Space Solution
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum

    Greenplum

    $2,000.00 $1,500.00
    Read More
  • Company
    • FAQs
    • About Us
    • Contact
  • Events
  • Portfolio
  • Blogs
    • Blog – RayaFeeL
    • Blog – PostgreSQL Support
    • Blog – PostgreSQL Migration
    • Blog – All DB’s
    • Blog – Linux
    • Blog – Medical Coding
      • Cart

        0

    Have any question?
    (+91)8838953252
    ITsupport@rayafeel.com
    RegisterLogin
    RayaFeeL
    • Home
    • Services
      • HR Services
        • HR Advisory Services
        • Contract Staffing
        • HR Outsourcing Services
        • Manpower Supply Services
        • Payroll Processing
        • Permanent Placement
        • Recruitment and Placement Services
        • Recruitment Process Outsourcing
        • Staffing Agency Services
      • DBA Support
        • DBA Consultancy Services
        • PostgreSQL Support
      • Website Maintenance
      • CoWorking/Virtual Office Space Solution
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum

      Greenplum

      $2,000.00 $1,500.00
      Read More
    • Company
      • FAQs
      • About Us
      • Contact
    • Events
    • Portfolio
    • Blogs
      • Blog – RayaFeeL
      • Blog – PostgreSQL Support
      • Blog – PostgreSQL Migration
      • Blog – All DB’s
      • Blog – Linux
      • Blog – Medical Coding
        • Cart

          0

      Reply To: How to fix double quotes problem while using postgres COPY command

      Home › Forums › PostgreSQL Database › How to fix double quotes problem while using postgres COPY command › Reply To: How to fix double quotes problem while using postgres COPY command

      February 10, 2019 at 11:31 am #16817
      2ndnijam
      Keymaster

      While Importing CSV files with text fields that contain double quotes using postgres COPY .
      By following steps you can neglect the double quotes at the time of using postgres COPY restoration

      1. connecting windows server

      D:
      cd D:\PostgresPlus\9.4AS\bin
      psql -U enterprisedb -d Health_DC

      2. Sample Data’s :

      "city_name"|"pincode"|"taluka_name"|"district_name"|"state_name"
      "Arong"|"744301"|"Car Nicobar"|"Nicobar"|"Andaman and Nicobar Islands"
      "Sawai"|"744301"|"Car Nicobar"|"Nicobar"|"Andaman and Nicobar Islands"
      "Chuckchucha"|"744301"|"Car Nicobar"|"Nicobar"|"Andaman and Nicobar Islands"
      "Kinyuka"|"744301"|"Car Nicobar"|"Nicobar"|"Andaman and Nicobar Islands"
      "Big Lapati"|"744301"|"Car Nicobar"|"Nicobar"|"Andaman and Nicobar Islands"
      "Perka"|"744301"|"Car Nicobar"|"Nicobar"|"Andaman and Nicobar Islands"

      3. following copy command will neglect the double quote

      2ndquadrant.in=# COPY ehis.citytemp FROM 'D:\InCampusDB/city_master_data.csv' DELIMITER '|' CSV HEADER;
      ERROR: character with byte sequence 0x9d in encoding "WIN1252" has no equivalent in encoding "UTF8"
      CONTEXT: COPY citytemp, line 358646

      You need to change the character set on your windows command line before running the script with chcp. Or in postgresql you can:

      SET CLIENT_ENCODING TO 'utf8';
      Before importing the file.

      2ndquadrant.in=# SET CLIENT_ENCODING TO 'utf8';
      SET
      2ndquadrant.in=# COPY ehis.citytemp FROM 'D:\InCampusDB/city_master_data.csv' DELIMITER '|' CSV HEADER;
      COPY 679249

      Search

      ADVERTISEMENT

      Latest Posts

      Rayafeel Business proposal
      18Apr2021
      24 Best Coworking Spaces in Chennai You Should Know
      13Apr2021
      Easy to get a Virtual Address in Chennai
      12Apr2021
      Easy to get a Virtual Office in Chennai
      12Apr2021
      What is a Virtual Office? And How to get in chennai ?
      11Apr2021

      Latest Courses

      PostgreSQL

      PostgreSQL

      $600.00 $500.00
      Greenplum

      Greenplum

      $2,000.00 $1,500.00

      Preview Course

      Free

      Recent Forum Topics

      • please let me know pre requirements to increase work_mem
      • how to copy some data in one table to another table in postgres
      • postgres script for finding queries more than 1 hours ?
      • How to take the tables backup in postgres
      • what are the extensions required to be in instance for performance

      2ndquadrant.in

      (+91) 8838953252

      ITsupport@rayafeel.com

      Company

      • About Us
      • Contact
      • Our Team
      • Blog

      COURSES

      • List Of Course
      • Become An Instructor
      • Events
      • Postgres Support Blog

      Support

      • DBA Support
      • Consultancy Services
      • Postgres Migration Blogs
      • Forum

      Recommend

      • Groups
      • Login
      • FAQs
      • SignUp

      IT Services by rayafeel.com. Powered by Rayafeel Technologies Pvt Ltd.

      • Privacy
      • Terms

      Become An Instructor?

      Join thousand of instructors and earn money hassle free!

      Get Started Now

      Login with:

      Login with Google Login with Twitter Login with LinkedIn Login with Microsoft

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account

      Are you a member? Login now