attachment_large_object
Provides a storage option for attachments as PostgreSQL large objects.
For general information on the three classical ways to store file-like content in a PostgreSQL DB, see this wiki page.
Also, check authors' blog post: https://anybox.fr/blog/postgresql-large-object-storage-for-odoo
Advantages
Odoo supports two types of storage:
- in-database storage is a base64 encoded text column.
- file system storage (tree of directories so that it scales well on linked lists based file systems such as EXT4)
Advantages over the default in-database storage
- better RAM efficiency (the bigger each individual file is, the more this is true)
- possibility to dump easily the base without the large objects (very useful for bug reproduction)
Advantages over the file system storage
Nothing can beat the file system in terms of read/write performance. That being said, large objects
- are transactional (fully ACID)
- work out of the box in multi-system setups (no need for NFS or similar file sharing tools)
- keep allowing easy, consistent backups of the whole system
Questions?
To get an assistance on this module contact us by email apps@it-projects.info
Contributors
- AnyBox <anybox.fr>
- Ivan Yelizariev <apps@it-projects.info>
Further information
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 51 |
| Technical Name |
itp_attachment_large_object |
| License | AGPL-3 |
| Website | https://it-projects.info |
attachment_large_object
Installation
- Install this module in a usual way
Configuration
Once the module is installed, to have ir.attachment records been stored as large objects by default, set the following record in ir.config_parameter:
| key: | ir_attachment.location |
|---|---|
| value: | postgresql:lobject |
Preexisting attachments are unaffected.
Warning
If you do that setting before installing the module you will get inconsistent data in ir.attachment field is_lobject will be set to True.
To apply new storage for all existed attachments use module ir_attachment_force_storage.
Uninstallation
Before uninstallation you need to move all large objects back to default storage type. One of the way to do it is as following:
- install module ir_attachment_force_storage
- set ir_attachment.location to file or db
- now you can safely unistall attachment_large_object and ir_attachment_force_storage
Please log in to comment on this module