Hi Sachin Kumar,
To resolve a situation similar to yours but with more than 70000000 records in a CSV file for each month in the year (with validation records in public transport), I used the following method: 1 - I created the file_fdw extension and a foreign data wraper 2 - I created a foreign table (FT) with the appropriate structure to support all fields in the CSV file (they can all be of the varchar type). I defined a name for that FT that could be used for all months of the year without needing to change the table definition 3 - I created the import destination table for each month's records with the appropriate column structure. 4 - I created the insertion instruction in the destination table from the selection of the FT, using, eventually, some restriction clause. I filled in some columns in the target table at the expense of expressions in the select clause of the statement. 5 - Assuming that the structure of the CSV file is the same in each of the following months, I only need to name the source file with the name used in the options of the definition of the destination FT. Dias Costa ------------------------------------------------------------------------------------ On 26-11-2020 10:14, Sachin Kumar wrote:
-- J. M. Dias Costa Telef. 214026948 Se divulgar esta mensagem por terceiros, por favor: 1. Apague o meu endereço de correio electrónico e o meu nome. 2. Apague também os endereços dos seus amigos antes de distribuir. 3. Enderece como cópia oculta (Cc ou Bcc) para os SEUS destinatários. Agindo deste modo, dificultará a disseminação de "vírus", "spams" e "banners" e contribuirá para manter a privacidade de todos e cada um. Obrigado. Nota: Não se deverá ao acaso a ocorrência de palavras na minha escrita que não respeitem o malfadado acordo ortográfico. |