The PostgreSQL documentation states that the COPY command can only be done on Tables, but I need to import a massive CSV file into a view.
The reason it needs to be a view, is because the CSV I've been given has a large number of [unnormalized] columns, and I would like to use a view (with INSERT Trigger) to parse the columns in, and assimilate them in to my [normalized] database tables.
This CSV File has between 20k-30k rows, so normalising the CSV is just not feasible.
This task of importing a CSV from is most likely going to occur more than a few times and so, using a view will make it easier to for me to come back in a few months and identify my import_stuff
table, rather than trying to have to try and remember what function to use.
Any ideas? as I just cannot waste 1-2 weeks trying to process this CSV each time (the CSV has many inconsistencies, like long trailing spaces on descriptions, wrong encoding, newlines in single line names, etc; that can take 3 days alone to clean, before normalizing the data)