Commit Graph
106 Commits
Author SHA1 Message Date
Cédric Krier b3ca13748b Add Exclude constraint
issue1422
review44061002
2018-03-19 16:57:49 +01:00
Nicolas Évrard acdbe5a08f Allow to perform unaccented searches on Char fields
issue7115
review44611002
2018-03-16 18:17:53 +01:00
Cédric Krier e778370e02 Ensure to put back the connection with a try/finally
This prevents to leak connection in the ThreadedConnectionPool of psycopg2.

issue7137
review39181002
2018-02-19 19:11:33 +01:00
Cédric Krier 291beaa10c Wait for the database accepting connection to run tests
issue6844
review43671002
2017-10-30 09:36:10 +01:00
Nicolas Évrard 06c4fe4868 Add support for PosgreSQL version >= 10 sequences
issue6789
review43531002
2017-10-02 17:59:16 +02:00
Nicolas Évrard ddb7769310 Move handling of sequences to the Database object
issue6788
review43521002
2017-10-02 17:48:23 +02:00
Cédric Krier 07d293caf8 Add support test database cache for remote postgresql
If pg_dump/pg_restore are not available, we create a copy of the database on
PostgreSQL server using the template option of "CREATE DATABASE". We still
create a file in the cache folder to know that there is a backup.

issue6699
2017-08-15 00:21:45 +02:00
Sergi Almacellas Abellana b637c503e7 Only convert dict fields when they are strings
issue6382
review28101002
2017-06-09 13:22:42 +02:00
Nicolas Évrard 12824d6457 Reset the database list cache on the right class
issue6429
review35371003
2017-04-17 00:17:09 +02:00
Sergi Almacellas Abellana 5b86281166 Add missing types mapping for Postgresql backend
issue6411
review34071002
2017-04-03 13:11:07 +02:00
Nicolas Évrard 5cee718423 Move low level handling of the SQL type to the backend
This changeset defines on the field the (somehow) abstract SQL type a field
should use letting the duty of specifying the real SQL type the database
supports and the conversion to/from the python types to the backend.

issue6351
review33951002
2017-03-31 12:44:22 +02:00
Sergi Almacellas Abellana 6575419cc9 Add window functions on Database
issue6355
review33961002
2017-03-22 10:49:26 +01:00
Nicolas Évrard f207968ba8 Remove assert on scheme from postgresql and mysql backends
issue6349
review27191002
2017-03-14 11:13:21 +01:00
Cédric Krier 601b8218e3 Do not log, as error, exception in cursor execute
There are expected exceptions that should not be logged and the others should
be logged by the caller.

issue6211
review26101002
2017-02-08 10:22:40 +01:00
Cédric Krier 7004574de7 Add logging on cursor execute
issue6211
review34651002
2017-02-02 12:06:55 +01:00
Cédric Krier 1b3dbec3b4 Ensure only one connection pool is created per database
It is too complex and expensive to lazy create the connection pool because all
methods which uses the pool needs to acquire a lock. So it is easier to create
it when the instance is also created. In this case, on closing the database, it
should be unregistered from the instances dictionary.

issue6202
review32991002
2017-01-29 01:15:45 +01:00
Cédric Krier c1b8ee10c6 Add has_select_for on Database
- Use has_select_for for ir.sequence.strict instead of lock

issue6134
review32911002
2017-01-25 23:21:57 +01:00
Nicolas Évrard d5e24102f3 Fix missing renaming of install to activate
issue1456
review28941002
2016-10-21 12:44:57 +02:00
Cédric Krier c0efe773f0 Fix has_attribute for AttributeError on _database
The code added from changeset 9b2e0aac2d9c does not work anymore because the
method has moved on the Database object and it requires a connection as
parameter.
So we add cache on the returned value to prevent to consume unnecessary
connection.

issue5818
2016-08-25 16:46:44 +02:00
Cédric Krier 8b9232ab81 Re-add has_returning for PostgreSQL
issue5818
review25621002
2016-08-25 15:38:07 +02:00
Sergi Almacellas Abellana 5967d21d46 Remove database management from RPC
issue5384
review29311002
2016-07-07 16:05:45 +02:00
Cédric Krier 1f9a834c9b Wait for a connection in PostgreSQL backend
If the pool is exhausted, we try to get one during few seconds before raising
an exception.

issue5435
review22911002
2016-05-10 10:35:23 +02:00
Cédric Krier 1b33a4b3ed Fix connection leak on postgresql
All connections must be put back to the pool otherwise they will never be
reused and so exhaust the pool limit.

issue5421
review20121002
2016-03-25 10:46:12 +01:00
Cédric Krier 1e0d860fe3 Use simple connection to list databases
When we instantiate a Database for each database to test, the threaded
connection pool keep one connection opens which could consume all the available
connections even if the databases are not really used.

issue5368
review16091002
2016-03-16 22:12:22 +01:00
Nicolas Évrard 2fef479575 Follow PEP-0249 for Transaction and backends
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Nicolas Évrard d0c5d9692a Remove buggy split introduced in changeset 5eb1afcd5fd6 2016-01-18 22:34:04 +01:00
Nicolas Évrard 88f1bce6d4 Strip and unquote double-quote from Postgresql schema in search_path
issue5248
review16931002
2016-01-18 19:09:48 +01:00
Sharoon Thomas 89de660c52 Move webdav into a separate module
issue4703
review7101002
2016-01-16 19:20:30 +01:00
Cédric Krier 109d0ef64f Manage PostgreSQL schema
Replace usage of pg_catalog tables by information_schema to take care of user
access.
Ensure to fetch the columns information from the right schema.
Prevent to update default column values if it did not change.
Comment table and column only if the current user is the owner.

issue4924
review24291002
2015-09-04 11:16:09 +02:00
Cédric Krier 6cd05ed6fe Add has_multirow_insert
There are still many databases that doesn't support this SQL-92 syntax.

issue4881
review19331002
2015-07-28 08:04:29 +02:00
Cédric Krier eddb17dea7 Re-factor dict* methods on each cursor into the interface
issue4807
review7241002
2015-06-15 01:18:07 +02:00
Cédric Krier 52ff97b165 Rename ir.module.module* into ir.module*
issue4764
review7171002
2015-05-28 21:02:01 +02:00
Cédric Krier 87ea42c126 Unquote username and password from URI
issue4747
review7131002
2015-05-19 09:48:07 +02:00
Albert Cervera i Areny f707c695e4 Close template1 connection on database restore.
review6241002
issue4717
2015-04-27 22:49:25 +02:00
Cédric Krier 58b357b55f Improve config to be Python3 compatible
issue4662
review14131002
2015-03-22 03:20:53 +01:00
Cédric Krier 39e7eeeadb Add support for psycopg2cffi and PyPy
issue4408
review11741002
2015-03-15 15:52:03 +01:00
Cédric Krier 20484bb013 Fix formatting in logger calls 2015-03-05 11:32:18 +01:00
Cédric Krier 0991a552de Add TimeDelta field
And remove float_time widget.

issue4026
review5911002
2015-02-09 22:58:56 +01:00
Cédric Krier de081a63e8 Fix typo when retrieving PGUSER from environ
introduced in changeset 277c10477f84
2015-01-17 17:19:44 +01:00
Mariano Benedettini 53194e3784 Fix database dump when port is specified in db uri
Since changeset 01399128964f, the uri port is an integer and so it must be
convert to string for command line.

issue4490
review6861002
2015-01-16 13:52:25 +01:00
Cédric Krier 4891d337c9 Use PGUSER for postgresql database list
psycopg2 uses the PGUSER environment variable if no user name defined.

issue4478
review11801002
2015-01-15 23:49:13 +01:00
Cédric Krier 324d75ec8c Use NOWAIT when locking a table
lock is used to enforce a serializable level for all transaction using on the
same table. This is not achieved if transactions are waiting for the lock
instead of abort and retry with a new transaction because they will still have
the initial transaction row values with the repeatable read level.

issue4373
review5901002
2015-01-03 11:37:24 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier e0b995abbe Refactore configuration to allow easy extention
issue3627
review7401002
2014-09-03 23:32:01 +02:00
Albert Cervera i Areny ce781a5d0e Use EXCLUSIVE MODE when locking PostgreSQL tables.
Previous implementation used ACCESS EXCLUSIVE MODE (PostgreSQL's default) which
does not allow SELECTs on the locked table. This is too pessimistic so it's been
replaced by a plain EXCLUSIVE MODE which still blocks INSERTs and UPDATEs
but not SELECTs.

review1011002
issue2280
2013-12-19 20:58:13 +01:00
Cédric Krier c46a026c40 Refactore Transaction to add close and autocommit
review2151002
2013-12-18 18:09:43 +01:00
Cédric Krier 17bbcef17d Remove unused regexp
review2081002
2013-12-06 11:45:07 +01:00
Cédric Krier be197317c8 Ensure same time zone between trytond and postgresql
issue3423
review1135002
2013-10-14 21:05:36 +02:00
Cédric Krier cbe59c6bb3 Remove print statement in Cursor.execute 2013-09-11 16:12:25 +02:00