日常记录 @ Mon, Feb 6, 2023 11:17 AM
日常记录 @ Mon, Feb 6, 2023 11:23 AM
Expand 47 lines ...
48
48
49
1.  `Provider` will hold the state of the atoms used in its subtree instead of the global store.
49
1.  `Provider` will hold the state of the atoms used in its subtree instead of the global store.
50
2.  `Provider`'s lifetime will be the same as the app itself, and since the app is recreated on each SSR request we essentially limit the lifetime of the store to a single request as well.
50
2.  `Provider`'s lifetime will be the same as the app itself, and since the app is recreated on each SSR request we essentially limit the lifetime of the store to a single request as well.
51
+
52
+
## PostgreSQL 重置主键自增
53
+
54
+
```sql
55
+
--- 清空表数据,重置主键自增
56
+
truncate table_name restart identity;
57
+
```
58
+
59
+
## PostgreSQL 关于时间/日期的操作符
60
+
61
+
> https://www.postgresql.org/docs/current/functions-datetime.html
62
+
63
+
64
+
| 操作符 | 例子 | 结果 |
65
+
| --- | --- | --- |
66
+
| + | date '2001-09-28' + integer '7' | date '2001-10-05' |
67
+
| + | date '2001-09-28' + interval '1 hour' | timestamp '2001-09-28 01:00:00' |
68
+
| + | date '2001-09-28' + time '03:00' | timestamp '2001-09-28 03:00:00' |
69
+
| + | interval '1 day' + interval '1 hour' | interval '1 day 01:00:00' |
70
+
| + | timestamp '2001-09-28 01:00' + interval '23 hours' | timestamp '2001-09-29 00:00:00' |
71
+
| + | time '01:00' + interval '3 hours' | time '04:00:00' |
72
+
| \- | \- interval '23 hours' | interval '-23:00:00' |
73
+
| \- | date '2001-10-01' - date '2001-09-28' | integer '3' (days) |
74
+
| \- | date '2001-10-01' - integer '7' | date '2001-09-24' |
75
+
| \- | date '2001-09-28' - interval '1 hour' | timestamp '2001-09-27 23:00:00' |
76
+
| \- | time '05:00' - time '03:00' | interval '02:00:00' |
77
+
| \- | time '05:00' - interval '2 hours' | time '03:00:00' |
78
+
| \- | timestamp '2001-09-28 23:00' - interval '23 hours' | timestamp '2001-09-28 00:00:00' |
79
+
| \- | interval '1 day' - interval '1 hour' | interval '1 day -01:00:00' |
80
+
| \- | timestamp '2001-09-29 03:00' - timestamp '2001-09-27 12:00' | interval '1 day 15:00:00' |
81
+
| \* | 900 \* interval '1 second' | interval '00:15:00' |
82
+
| \* | 21 \* interval '1 day' | interval '21 days' |
83
+
| \* | double precision '3.5' \* interval '1 hour' | interval '03:30:00' |
84
+
| / | interval '1 hour' / double precision '1.5' | interval '00:40:00' |