title: Postgresql insert ptoblem on two self referenced tables
body: <p>I have this table</p>
  
  <pre><code>CREATE TABLE users (
    id integer DEFAULT nextval('users_id_seq'::regclass) NOT NULL PRIMARY KEY,
    username character varying(100) NOT NULL,
    key character varying NOT NULL,
    registerdate timestamp without time zone DEFAULT now(),
    folder_id integer NOT NULL
  );
  
  CREATE TABLE folders (
      id integer DEFAULT nextval('folders_id_seq'::regclass) NOT NULL PRIMARY KEY,
      enc_name character varying(500),
      small_name character varying(50),
      owner integer NOT NULL,
      master boolean DEFAULT false
  );
  ALTER TABLE ONLY folders
      ADD CONSTRAINT folders_owner_fkey FOREIGN KEY (owner) REFERENCES users(id);
  ALTER TABLE ONLY users
      ADD CONSTRAINT folder_c_id FOREIGN KEY (folder_id) REFERENCES folders(id);
  </code></pre>
  
  <p>Table users references folder and folders references users<br>
  Every user have his own master folder and every folder belongs to some user. When a new user is created, a new folder need to be created too. But columns users.folder_id(NOT NULL) and folders.owner(NOT NULL) are both not null.<br>
  So if I wanna create new user entry I need a folder already created, and if I wanna create a new folder I need an user already created.<br>
  How can I create them? <br></p>