Philip Warner <pjw@rhyme.com.au> writes:
>> 1. What if the inherited object is a table or a sequence?
> The only solution I can think of for this would be to use lastsysoid from
> template1; this is the value set when initdb runs.
How does that help? It won't tell you anything about updated or deleted
rows, nor about sequence advances, nor ALTER FUNCTION changes. You
could detect inserted rows, and that's about it.
>> 3. What if the OID counter wraps around?
> Can the code that wraps the OID restart it at 'select max(lastsysoid) from
> pg_database'? Is that too complex?
What if lastsysoid is MAXINT minus just a little? Not very workable,
even if it were possible for the OID counter to work that way, which
I don't think it is (the OID allocator is way too low-level to go off
invoking arbitrary queries with safety).
regards, tom lane