| От | Peter Eisentraut |
|---|---|
| Тема | some pg_dump query code simplification |
| Дата | |
| Msg-id | bb58198d-ad00-67cc-20da-6675739bebcc@2ndquadrant.com обсуждение исходный текст |
| Ответы |
Re: some pg_dump query code simplification
|
| Список | pgsql-hackers |
There is a lot of version dependent code in pg_dump now, especially per-version queries. The way they were originally built was that we just have an entirely separate query per version. But as the number of versions and the size of the query grows, this becomes unwieldy. So I tried, as an example, to write the queries in getTableAttrs() differently. Instead of repeating the almost same large query in each version branch, use one query and add a few columns to the SELECT list depending on the version. This saves a lot of duplication and is easier to deal with. I think this patch is useful in its own right, but there is also the larger question of whether people think this is a better style going forward, for pg_dump and psql. (It's already in use in psql in some places.) It won't always work, if the query structure is very different between versions, but as this example shows, it can be useful. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера