Skip to Content
Menu
This question has been flagged

Hello all,

I have at least 10 odoo servers (odoo 8, 9, 10) running on my Ubuntu machine. All is running well since many many months.

All these odoo servers use the same Postgresql server. All the databases on the same postgresql server.

Each day, I dump each odoo database (with pg_dump) in a sql file, I create automatically a new database (with createdb) and I automatically reimport this sql file into the new database (with psql). I reimport each sql file in a new database just to test the importation.

I saw in my log this morning this error when the sql file is imported :

ERROR:  duplicate key value violates unique constraint "pg_largeobject_metadata_oid_index"DETAIL:
  Key (oid)=(35848143) already exists.


When digging to manage this error, I see that 8 of my 10 odoo databases have EXACTLY the same largeobjet.

So these 8 odoo databases trigger all the exactly same error when they backup.

(pg_largeobject and pg_largeobject_metadata are exactly the same for 8 of my 10 odoo server database)



How can it be possible? Why do totally different odoo server can have the same 'largeobject' in their respective database?

Thanks for your comment


EDIT #1

In one of my odoo database, I ran this SQL query in PGAdmin III to delete the largeobject :

SELECT lo_unlink(l.oid) FROM pg_largeobject_metadata l;

After, I ran the backup script ans the error is no more there.

But it doesn't explain to me what was this large object... And why it was exactly the same in 8 different odoo databases...


EDIT #2

In PGAdmin III,

File->Options... UI Miscellaneous, I have checked 'Show System Objects in the treeview'.

Now, I can see 'template0' and 'template1' databases in PGAdmin.

When I edit 'template1', the same largeobject is there... So I would say that my odoo databases were created using this model 'template1'.

So, I will see to delete this large object from 'template1'.


Avatar
Discard
Related Posts Replies Views Activity
1
Nov 23
1376
1
Aug 20
4163
4
Dec 22
9752
6
Dec 19
2878
3
Mar 15
30552