对于我的用例,我试图让这样的东西与 Azure 数据工厂(ADF)一起使用
但我也从理论的角度对这个问题感兴趣。是否可以在像 postgres 这样的普通 SQL 引擎中做这样的事情?
我想禁止基于此键插入: (non_unique_id, timestamp) 其中时间戳是该对的唯一值。
例如:
non_unique_id: 0cf6c19c14
timestamp: 1970-01-01 00:00:01
Run Code Online (Sandbox Code Playgroud)
插入前:
select non_unique_id, timestamp from tbl where non_unique_id = 0cf6c19c14;
0 results
Run Code Online (Sandbox Code Playgroud)
插入前:
select non_unique_id, timestamp from tbl where non_unique_id = 0cf6c19c14;
0cf6c19c14, 1970-01-01 00:00:01
0cf6c19c14, 1970-01-01 00:00:01
0cf6c19c14, 1970-01-01 00:00:01
...
Run Code Online (Sandbox Code Playgroud)
插入前:
select non_unique_id, timestamp from tbl where non_unique_id = 0cf6c19c14;
0cf6c19c14, 2038-01-19 03:14:05
0cf6c19c14, 2038-01-19 03:14:05
0cf6c19c14, 2038-01-19 03:14:05
... …Run Code Online (Sandbox Code Playgroud)