Re: Conditional query with copy command

Поиск
Список
Период
Сортировка
От Holger Jakobs
Тема Re: Conditional query with copy command
Дата
Msg-id f05f4e12-8eea-62fe-4a7b-3e5a0298aaf0@jakobs.com
обсуждение исходный текст
Ответ на Conditional query with copy command  (Sachin Kumar <sachinkumaras@gmail.com>)
Ответы Re: Conditional query with copy command
Список pgsql-admin

Hi,

Use the new syntax as of PostgreSQL 9.0:

copy hk_card_master_test from 'C:/inetpub/wwwroot/cards/media/static/gc_card_master2L.csv' (format csv, header, encoding 'ISO_8859_5') where card_status = 'A'

This allows a simple WHERE condition as shown.


Am 26.11.20 um 09:27 schrieb Sachin Kumar:
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
-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
Вложения

В списке pgsql-admin по дате отправления:

Предыдущее
От: Sachin Kumar
Дата:
Сообщение: Conditional query with copy command
Следующее
От: Sachin Kumar
Дата:
Сообщение: Re: Conditional query with copy command