I am trying to move data from one table to another:
zuri=# INSERT INTO lili_code (uuid, arrow, popularname, slug, effdate, codetext)
SELECT uuid, arrow, popularname, slug, effdate, codetext
FROM newarts;
ERROR: null value in column "shorttitle" violates not-null constraint
My Question: shorttitle is NOT one of the columns I was trying to fill, so why does it matter if it is null or not?
Please note:
- shorttitle is blank=True. I understand this is != null, but I thought it might be relevant.
- There are a lot of additional columns in lili_code besides shorttitle that weren't in newarts.
At this point it looks to me like my only options are
a. inserting by hand (yuck!)
b. making a csv and importing that
c. adding all the missing columns from lili_code to newarts and making sure they are NOT NULL and have at least a default value in them.
Have I missed an option? What's the best solution here? I'm using django 1.9.1, python 2.7.11, Ubuntu 15.10, and Postgresql 9.4.
Thanks as always.