Re: OWNER TO on all objects

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: OWNER TO on all objects
Дата
Msg-id 40D15883.5000707@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: OWNER TO on all objects  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: OWNER TO on all objects  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список 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 по дате отправления:

Предыдущее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: OWNER TO on all objects
Следующее
От: Darko Prenosil
Дата:
Сообщение: SPI question