title: Postgresql-Insert value come up with non-null conflict
body: <pre><code>insert into "StarSchema"."Customer" 
  (address,address2,district,postal_code,phone)
  select address,address2,district,postal_code,phone
  from public.address;
  </code></pre>
  
  <p>I'm trying to insert value from another table into the table I created just now. But I don't know why there are conflict of non-null. As this query didn't contain (customer_id) which is the primary key. And I didn't have any value defined in schema require non-null. There are some values in address2 and postal_code are null. When I remove these two columns in queries. Everything works fine. Is there any method to bring all columns into the new table?</p>
  
  <pre><code>    CREATE TABLE "StarSchema"."Customer"
  (
      first_name character varying COLLATE pg_catalog."default",
      last_name character varying COLLATE pg_catalog."default",
      activebool boolean,
      create_date date,
      address character varying COLLATE pg_catalog."default",
      address2 character varying COLLATE pg_catalog."default",
      district character varying COLLATE pg_catalog."default",
      postal_code character varying COLLATE pg_catalog."default",
      city character varying COLLATE pg_catalog."default",
      country character varying COLLATE pg_catalog."default",
      phone character varying COLLATE pg_catalog."default",
      customer_id integer NOT NULL,
      email character varying COLLATE pg_catalog."default",
      active integer,
      CONSTRAINT "Customer_pkey" PRIMARY KEY (customer_id)
  )
  </code></pre>
  
  <p>The error information in the question is
  Error: Null value violates non-null constraint in field "customer_id"</p>
  
  <p><a href="https://i.stack.imgur.com/3mF2t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3mF2t.png" alt="enter image description here"></a></p>