Re: OWNER TO on all objects - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: OWNER TO on all objects
Date
Msg-id 40D15883.5000707@familyhealth.com.au
Whole thread Raw
In response to Re: OWNER TO on all objects  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: OWNER TO on all objects
List pgsql-hackers
> I think this is wrong, primarily because it's gonna be seriously
> incompatible with existing dump files.  The existing technique is
> that each TOC entry says who owns the object.  You should use that
> information and not have to rely on new additions to the file format.

> This is why GRANT/REVOKE has to be postponed to the end.  I think it
> would be a lot simpler and more reliable if you also postponed ALTER
> OWNER.

OK, implementing this is nasty.  How do I collect up all the ACLs from 
EXISTING custom archives and move them to the end??  This is hard 
because ACLs are just dependents on their parent object and cannot be 
sorted on their own to the end of the dump.

Since the dumping process outputs to stdout as it goes along, I'd have 
to create some big in-memory string of all acls and owners collected so 
far.  That seems bad.

The alternative is to scan the entire archive twice.  On the second scan 
I would only output owner and acl commands.

Another option is to simply not bother fixing old custom dumps.  They 
could just still restore exactly how they would have without any changes 
from me.  I would add new TOC types to the 7.5 pg_dump that could be 
sorted to the end...

What do I do?

Chris



pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: OWNER TO on all objects
Next
From: Darko Prenosil
Date:
Subject: SPI question