But, as David suggested, I'd also recommend to do an intermediate step, and load the data into a table, or pre-process the file to be how you want it.
On Thu, Oct 27, 2022 at 7:19 PM David G. Johnston <[email protected]> wrote:
On Thu, Oct 27, 2022 at 5:02 AM Rama Krishnan <[email protected]> wrote:
Hi team,
We are getting csv file from client to upload data in my db table , one particular column I. E clinet description column contains more than 100 character hence I am getting value too long varchar (100) so we decided to upload db only first 100 characters. How to use this thing in copy command
You cannot. Either fix the content of the file or remove the arbitrary length limitation on the field (i.e., change the type to "text"). I suggest the later. You may also,copy into a temporary staging table that lacks the limit, then use insert to move the transformed data (via a select query) into the production table.