Conditional query with copy command

From: Sachin Kumar <sachinkumaras(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Conditional query with copy command
Date: 2020-11-26 08:27:37
Message-ID: CALg-PKDeVkeia_6Dv-_Tc0wm4qQVYPioe9i+D-FhERx84aKEzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Experts,

I am uploading 10 million data using CSV, but I want to put a condition on
a column (Card_Status) inside the CSV that only where Card_Status = A data
should be uploaded rest data are not uploaded.
Please guide me in modifying the query I am using to upload the data
Query:-
copy hk_card_master_test from
'C:/inetpub/wwwroot/cards/media/static/gc_card_master2L.csv' with delimiter
',' csv header encoding 'ISO_8859_5'

--

Best Regards,
Sachin Kumar

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Holger Jakobs 2020-11-26 09:42:49 Re: Conditional query with copy command
Previous Message Sachin Kumar 2020-11-26 08:09:04 Re: PG Admin 4.28 is crashing while viewing 10M row data