I have an issue using FORCE NOT NULL in PostgreSQL.
I have a table with 10 columns and I need to load data to it from a CSV file.
I'm using the following query, which works perfectly:
COPY "myschema"."mytable"
FROM '/var/www/myapp/myfile.csv'
DELIMITERS '|'
CSV
FORCE NOT NULL
attr1, attr2, attr3, attr4, attr5, attr6, attr7, attr8, attr9, attr10;
I need to know how to do this without explicitly coping all the columns as arguments to the FORCE NOT NULL because I have more tables with hundreds of columns that require this.
I tried FORCE NOT NULL *, FORCE NOT NULL * but the query returns an error. I can't find a solution to this on the Internet.
Thanks in advance for the help you can provide me!