summary refs log tree commit diff
path: root/synapse/storage/engines/postgres.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix the inbound PDU metric (#10279)Erik Johnston2021-06-301-0/+5
| | | This broke in #10272
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Drop support for sqlite<3.22 as wellRichard van der Hoff2021-04-081-7/+0
|
* Require py36 and Postgres 9.6Richard van der Hoff2021-04-081-2/+2
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-2/+1
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Reduce serialization errors in MultiWriterIdGen (#8456)Erik Johnston2020-10-071-1/+9
| | | | | | We call `_update_stream_positions_table_txn` a lot, which is an UPSERT that can conflict in `REPEATABLE READ` isolation level. Instead of doing a transaction consisting of a single query we may as well run it outside of a transaction.
* Use SequenceGenerator for state group ID allocationRichard van der Hoff2020-07-161-6/+0
|
* Fix incorrect error message when database CTYPE was set incorrectly. (#7760)Richard van der Hoff2020-07-011-1/+1
|
* Add some type annotations in `synapse.storage` (#6987)Richard van der Hoff2020-02-271-5/+7
| | | | | I cracked, and added some type definitions in synapse.storage.
* Updated warning for incorrect database collation/ctype (#6985)Uday Bansal2020-02-261-3/+7
| | | Signed-off-by: Uday Bansal <43824981+udaybansal19@users.noreply.github.com>
* Warn if postgres database has non-C locale. (#6734)Erik Johnston2020-01-281-0/+42
| | | As using non-C locale can cause issues on upgrading OS.
* Refuse to start if sqlite is older than 3.11.0Richard van der Hoff2020-01-091-2/+2
|
* Check postgres version in check_databaseRichard van der Hoff2020-01-091-13/+12
| | | | | this saves doing it on each connection, and will allow us to pass extra options in.
* Modify check_database to take a connection rather than a cursorRichard van der Hoff2020-01-091-8/+9
| | | | We might not need the cursor at all.
* Merge pull request #6156 from matrix-org/erikj/postgres_anyErik Johnston2019-10-101-0/+6
|\ | | | | Use Postgres ANY for selecting many values.
| * Remove add_in_list_sql_clauseErik Johnston2019-10-101-0/+6
| |
* | Disable bytes usage with postgresErik Johnston2019-10-081-0/+7
|/ | | | | | | | More often than not passing bytes to `txn.execute` is a bug (where we meant to pass a string) that just happens to work if `BYTEA_OUTPUT` is set to `ESCAPE`. However, this is a bit of a footgun so we want to instead error when this happens, and force using `bytearray` if we actually want to use bytes.
* Fix `devices_last_seen` background update.Erik Johnston2019-09-301-0/+7
| | | | Fixes #6134.
* Remove Postgres 9.4 support (#5448)Amber Brown2019-06-181-2/+6
|
* Run black on the rest of the storage module (#4996)Amber Brown2019-04-031-11/+4
|
* Add database version to phonehome stats. (#4753)Richard van der Hoff2019-02-271-0/+25
|
* Use native UPSERTs where possible (#4306)Amber Brown2019-01-241-0/+14
|
* Port storage/ to Python 3 (#3725)Amber Brown2018-08-311-2/+7
|
* Store state groups separately from events (#2784)Erik Johnston2018-02-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Split state group persist into seperate storage func * Add per database engine code for state group id gen * Move store_state_group to StateReadStore This allows other workers to use it, and so resolve state. * Hook up store_state_group * Fix tests * Rename _store_mult_state_groups_txn * Rename StateGroupReadStore * Remove redundant _have_persisted_state_group_txn * Update comments * Comment compute_event_context * Set start val for state_group_id_seq ... otherwise we try to recreate old state groups * Update comments * Don't store state for outliers * Update comment * Update docstring as state groups are ints
* Optionally make committing to postgres asynchronous.Mark Haines2016-06-201-1/+12
| | | | | Useful when running tests when you don't care whether the server will lose data that it claims that it has committed.
* Don't require config to create databaseErik Johnston2016-04-061-7/+1
|
* Mark AS users with their AS's IDDaniel Wagner-Hall2016-02-111-2/+3
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* rename schema_prepare to prepare_databaseErik Johnston2015-10-131-1/+1
|
* Expose error more nicelyErik Johnston2015-10-131-1/+1
|
* Split out the schema preparation and update logic into its own moduleErik Johnston2015-10-131-1/+1
|
* Remove race conditionErik Johnston2015-05-141-0/+2
|
* Don't call 'encode_parameter' no-opErik Johnston2015-05-051-3/+0
|
* Fix bug where we reconnected to the database on every query.Erik Johnston2015-05-011-1/+1
|
* Make postgres database error slightly more helpfulErik Johnston2015-04-291-1/+2
|
* Check that postgres database has correct charset setErik Johnston2015-04-291-0/+11
|
* Shuffle operations so that locking upsert happens last in the txn. This ↵Erik Johnston2015-04-271-0/+3
| | | | ensures the lock is held for the least amount of time possible.
* Handle the fact that postgres databases can be restarted from under usErik Johnston2015-04-271-0/+3
|
* Go back to storing JSON in TEXTErik Johnston2015-04-161-3/+0
|
* Correctly identify deadlocksErik Johnston2015-04-151-1/+1
|
* Add postgres database engineErik Johnston2015-04-141-0/+44