Displaying 1 result from an estimated 1 matches for "quota2_pkey".
2019 Sep 03
0
Quota count and clone questions
...after all this time, but in any case.
Since quota_clone is not cumulative, it always inserts new record with actual quota,
to be able to get correct results in postfixadmin one must:
DROP TRIGGER mergequota2 ON quota2;
And to prevent ERROR: duplicate key value violates unique constraint "quota2_pkey":
CREATE FUNCTION public.clone_quota2() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE quota2 SET bytes = NEW.bytes,
messages = NEW.messages
WHERE username = NEW.username;
IF found THEN
RETURN NULL;...