code: func (dct *DjangoContentType) Upsert(db XODB) error {
  	var err error
  
  	// if already exist, bail
  	if dct._exists {
  		return errors.New("insert failed: already exists")
  	}
  
  	// sql query
  	const sqlstr = `INSERT INTO public.django_content_type (` +
  		`id, app_label, model` +
  		`) VALUES (` +
  		`$1, $2, $3` +
  		`) ON CONFLICT (id) DO UPDATE SET (` +
  		`id, app_label, model` +
  		`) = (` +
  		`EXCLUDED.id, EXCLUDED.app_label, EXCLUDED.model` +
  		`)`
  
  	// run query
  	XOLog(sqlstr, dct.ID, dct.AppLabel, dct.Model)
  	_, err = db.Exec(sqlstr, dct.ID, dct.AppLabel, dct.Model)
  	if err != nil {
  		return err
  	}
  
  	// set existence
  	dct._exists = true
  
  	return nil
  }
docs: // Upsert performs an upsert for DjangoContentType.
  //
  // NOTE: PostgreSQL 9.5+ only