[pgadmin-hackers] inconsistent sql template path resolving

Поиск
Список
Период
Сортировка
От Atira Odhner
Тема [pgadmin-hackers] inconsistent sql template path resolving
Дата
Msg-id CA+Vc24r_V3K0mB-=QSt5FSCxLT5QtvWJAkqgOrChuOM=1uGBYQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [pgadmin-hackers] inconsistent sql template path resolving  (Atira Odhner <aodhner@pivotal.io>)
Список pgadmin-hackers
Hello fellow pgadmin hackers,

I was taking a look at some version-checking code and I noticed some inconsistencies in how we are picking what sql file to run: 

ver = self.manager.version
if ver >= 90200:
self.template_path = 'exclusion_constraint/sql/9.2_plus'
elif ver >= 90100:
self.template_path = 'exclusion_constraint/sql/9.1_plus'
versus:

ver = self.manager.version
if ver >= 90600:
self.template_path = 'exclusion_constraint/sql/9.6_plus'
elif ver >= 90200:
self.template_path = 'exclusion_constraint/sql/9.2_plus'
elif ver >= 90100:
self.template_path = 'exclusion_constraint/sql/9.1_plus'

In this particular example the sql template file contents for 9.6+ and 9.1+ are identical so it wouldn't have any effect, but in general is there some reason this might be intentional? I'm planning on refactoring this code to: 
self.template_path = resolve(self.manager, 'exclusion_constraint')
and making all the places behave the same way.


Thanks,

Tira

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

Предыдущее
От: Fahar Abbas
Дата:
Сообщение: Re: [pgadmin-hackers] Re: PATCH: RM# 1679 - Background process for"restore" not reporting status back to pgAdmin
Следующее
От: Atira Odhner
Дата:
Сообщение: Re: [pgadmin-hackers] inconsistent sql template path resolving