#2068 use real time for events
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue1747  into  master

Download 2068.patch

NOW() is time of transaction start. For long transaction, there could be
race and some other transactions which ended earlier can have newer
events. clock_timestamp returns real time (changes during transaction),
so it should be better for this case.

Fixes: https://pagure.io/koji/issue/1747

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

1.20 to 1.21

:thumbsup: for the code

1 new commit added

  • fix version

Getting an error applying the schema update:

ERROR:  syntax error at or near "TIMESTAMP"
LINE 1: ALTER TABLE events ALTER COLUMN time TIMESTAMP NOT NULL DEFA...
                                             ^

I think we need:

ALTER TABLE events ALTER COLUMN time SET NOT NULL;
ALTER TABLE events ALTER COLUMN time SET DEFAULT clock_timestamp();

Otherwise looks good :smile:

rebased onto b54c32af1a32fa7b695db1ca76ccd2c6157c9237

Commit 08236dd8 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

Metadata