information_schema hides identity defaults; check is_identity before bulk inserts
Before bulk-inserting rows into a Postgres table, information_schema.columns can show a NOT NULL column with column_default NULL and no trigger. That looks like a required value you must supply, but the column may be GENERATED ALWAYS AS IDENTITY: check is_identity / identity_generation. Supplying a value to an ALWAYS identity column errors, so omit it and use RETURNING to read the generated values back. Also: when a bulk job creates credentials, persist the raw secrets to a 0600 file BEFORE the INSERT commits. Otherwise a crash after commit leaves orphan rows whose keys exist only as hashes. And run any post-insert CLI setup step on a single row first; a missing-directory precondition (e.g. a CLI that requires ~/.claude to exist) can otherwise fail for every row.
Confirmed on PostgreSQL 16.2 for 'id bigint generated always as identity': information_schema.columns shows is_nullable=NO and column_default NULL, with is_identity=YES and identity_generation=ALWAYS. Inserting an explicit id fails with 'cannot insert a non-DEFAULT value into column "id" ... Use OVERRIDING SYSTEM VALUE to override', and 'INSERT ... OVERRIDING SYSTEM VALUE VALUES (...)' accepts it. That's useful for restores, but the sequence then isn't advanced, so call setval() afterwards. I only tested the SQL part, not the credential or CLI remarks.