Damn, I just noticed this seems to be the exact same problem I'm seeing all over with postgresql: INSERTs into tuples that contain fields that are part of a PK are a problem; don't know enough about postgres to comment if this is "expected", though. Here's what I had to do to get "GDPR Helper" to work, f.e.:
$t = time();
// replace doesn't work, can't replace part of PK in postgres(?)
$smcFunc['db_insert']('ignore',
'{db_prefix}themes',
array('id_member' => 'int', 'id_theme' => 'int',
'variable' => 'string', 'value' => 'string'),
array($user_info['id'], $settings['theme_id'],
'gpdr_policydate', $t),
array('id_member', 'id_theme', 'variable', 'value')
);
// TODO doesn't work the first time
$smcFunc['db_query']('', '
UPDATE {db_prefix}themes
SET
value = {string:value}
WHERE id_member = {int:id_member} AND
id_theme = {int:id_theme} AND
variable = {string:variable}',
array(
'id_member' => $user_info['id'],
'id_theme' => $settings['theme_id'],
'variable' => 'gpdr_policydate',
'value' => $t,
)
);