cockroachDB doesn't support this syntax (#1509)

This commit is contained in:
Jake Sanders 2020-04-09 12:11:24 +01:00 committed by GitHub
parent 1063b954de
commit 2659215d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -277,7 +277,7 @@ func (s *sqlStore) initDB() error {
s.readOffset = readOffset s.readOffset = readOffset
write, err := s.db.Prepare(fmt.Sprintf(`INSERT INTO %s.%s(key, value, expiry) write, err := s.db.Prepare(fmt.Sprintf(`INSERT INTO %s.%s(key, value, expiry)
VALUES ($1, $2::bytea, $3) VALUES ($1, $2::bytea, $3)
ON CONFLICT ON CONSTRAINT %s_pkey ON CONFLICT (key)
DO UPDATE DO UPDATE
SET value = EXCLUDED.value, expiry = EXCLUDED.expiry;`, s.database, s.table, s.table)) SET value = EXCLUDED.value, expiry = EXCLUDED.expiry;`, s.database, s.table, s.table))
if err != nil { if err != nil {