3,765
回編集
差分
→2022-12 -14
nusi = true;
INSERT 0 1304</nowiki>
テーブルの増分を求める
<nowiki>update_dump=# SELECT created_at FROM clients_new EXCEPT SELECT created_at FROM clients;
created_at
----------------------------
2022-11-20 11:38:24.975644
2021-10-09 17:50:13.19454
2022-11-18 18:24:26.100683
2022-12-02 14:31:59.651794
2020-01-05 16:08:24.725981
2022-10-13 18:18:47.00945
2022-10-16 12:13:27.960598
2022-09-19 17:04:20.793626
2022-10-14 21:58:23.012871
2022-09-26 18:41:40.679061
(10 rows)</nowiki>
update_dump=# select * from clients_new where created_at > '2022-09-19';
書き出す
% psql -d update_dump -U jq -c "select * from clients_new where created_at > '2022-09-19'" -F, > ../clients_add.csv
<nowiki>tep5_development=# INSERT INTO clients (id, user_id, note_id, list_id, content, created_at, updated_at) VALUES
(35375,2,3,1,'支所','2022-11-18 18:24:26.100683','2022-11-18 18:24:26.108051'),
(5360,2,1,1,'広島門会','2022-10-13 18:18:47.00945 ','2022-10-13 18:18:47.023412'),
.
.
.
(25362,13,2,1,'岡山族会','2022-10-16 12:13:27.960598','2022-10-16 12:13:27.968872');
INSERT 0 7</nowiki>
==== 旧clientsテーブルをリストアする ====