Re: ADD/DROP INHERITS - Mailing list pgsql-hackers

From Greg Stark
Subject Re: ADD/DROP INHERITS
Date
Msg-id 87k67rjwuw.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: ADD/DROP INHERITS  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ADD/DROP INHERITS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> BTW ... are you intending to renumber inhseqno entries of remaining
> pg_inherits items after DROP INHERITS?  Which seqno will be assigned
> by ADD INHERITS?  This seems like another area in which DROP/ADD will
> not be a complete no-op.

I assigned inhseqno to be max(inhseqno)+1. I was already scanning the parents
to check for duplicate parents so I just accumulated a maximum seqno at the
same time.

It's not a precise noop in database internal data structures, but I don't see
any user-visible effects switching around seqnos would have. But maybe there's
something I don't know about?

The actual order only seems to be significant in that it affects the ordering
of inherited columns. But that's already thrown to the wind as soon as you
allow adding new parents anyways. I'm just matching by name regardless of
position. And in any case that is only going to match the original ordering of
the original sequno ordering.

I did wonder whether it was kosher to leave holes.

-- 
greg



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [PATCHES] drop if exists remainder
Next
From: Tom Lane
Date:
Subject: Re: Ending EXPLAIN ANALYZE early (was Re: That EXPLAIN ANALYZE patch still needs work)