Re: pg_dump --split patch

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: pg_dump --split patch
Дата
Msg-id AANLkTimijFkHGL2QJEQ1eroiZCXLejFfu2yWMMTEK6Ac@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_dump --split patch  (Gurjeet Singh <singh.gurjeet@gmail.com>)
Ответы Re: pg_dump --split patch  (Gurjeet Singh <singh.gurjeet@gmail.com>)
Re: pg_dump --split patch  (David Wilson <david.t.wilson@gmail.com>)
Список pgsql-hackers
2010/12/28 Gurjeet Singh <singh.gurjeet@gmail.com>
I would suggest the directory structure as:

/crypt/pg.dump-split/schema-name-1/VIEWS/view-name-1.sql
/crypt/pg.dump-split/schema-name-1/TABLES/table-name-1.sql
...
/crypt/pg.dump-split/schema-name-2/VIEWS/view-name-1.sql
/crypt/pg.dump-split/schema-name-2/TABLES/table-name-1.sql

This might n be more amenable to diff'ing the different dumps. Schemas are logical grouping of other objects and hence making that apparent in your dump's hierarchy makes more sense.

Thanks Gurjeet and Tom for good feedback!

I've made some changes and attached new patches.
Looks much better now I think!

This is what I've changed,

*) Not using oid anymore in the filename
*) New filename/path structure: [-f filename]-split/[schema]/[desc]/[tag].sql
*) If two objects share the same name tag for the same [schema]/[desc], -2, -3, etc is appended to the name. Example:
~/pg.dump-split/public/FUNCTION/foobar.sql
~/pg.dump-split/public/FUNCTION/foobar-2.sql
~/pg.dump-split/public/FUNCTION/barfoo.sql
~/pg.dump-split/public/FUNCTION/barfoo-2.sql
~/pg.dump-split/public/FUNCTION/barfoo-3.sql

I think you are right about functions (and aggregates) being the only desc-type where two objects can share the same name in the same schema.
This means the problem of dumping objects in different order is a very limited problem, only affecting overloaded functions.

I didn't include the arguments in the file name, as it would lead to very long file names unless truncated, and since the problem is very limited, I think we shouldn't include it. It's cleaner with just the name part of the tag in the file name.

--
Best regards,

Joel Jacobson
Glue Finance
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: SLRU overview
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: "writable CTEs"