| Summary | Sequence reset incompatible with PostgreSQL 10+ |
| Queue | Horde Base |
| Queue Version | 5.2.20 |
| Type | Bug |
| State | Unconfirmed |
| Priority | 2. Medium |
| Owners | |
| Requester | stefan (at) stklcode (dot) de |
| Created | 11/26/2018 (2524 days ago) |
| Due | |
| Updated | 02/10/2020 (2083 days ago) |
| Assigned | |
| Resolved | |
| Github Issue Link | |
| Github Pull Request | |
| Milestone | |
| Patch | No |
https://github.com/horde/Db/pull/1
One of our Devs suggested to use this in a similar case which should
work on all PostgreSQL versions at least since 9
select increment from information_schema.sequences where
sequence_schema='{schema}' and sequence_name='{sequence}'
Priority ⇒ 2. Medium
New Attachment: horde-seq-pg11.log
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Sequence reset incompatible with PostgreSQL 10+
Type ⇒ Bug
State ⇒ Unconfirmed
operations fail when trying to reset a sequence.
Example to reproduce:
Create a new event in Kronolith raises an error (see attached log).
After refreshing the page the event is created successfully.
Cause:
Method "resetPkSequence" in file
"pear/Horde/Db/Adapter/Postgresql/Schema.php" executes the following
SQL:
SELECT setval(%s, (SELECT COALESCE(MAX(%s) + (SELECT increment_by FROM
%s), (SELECT min_value FROM %s)) FROM %s), false)
Sequence column "increment_by" is no longer available in PostgreSQL 10
and above.