PostgreSQL: Do regclass/oid columns persist across backups?
6
votes
3
answers
913
views
I have a large table (audit) in which I store relation ID of the schema and table.
This is conveniently populated by trigger using TG_RELID.
It is also convenient because I can index it and the index would be smaller than if I were to store "schema"(text) and "table"(text) columns separately and index them.
Also, I can then do queries using
WHERE relation_id = 'myschema:mytable'::regclass
and it just works.
My question is if this is "safe" to do in terms of backup/restore (will the schema.table have the same regclass/oid in target server and it did in the source server?
Any other issue I should be aware of?
Asked by zam6ak
(491 rep)
Jul 21, 2017, 07:46 PM
Last activity: Mar 18, 2023, 10:59 AM
Last activity: Mar 18, 2023, 10:59 AM