Re: inconsistent sql template path resolving

From: Atira Odhner <aodhner(at)pivotal(dot)io>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: inconsistent sql template path resolving
Date: 2017-01-23 21:28:13
Message-ID: CA+Vc24ogO87cYEoF5U9rNJYWp4YTcmo+n3SNMQF5sfJi1HhdiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Nevermind, I think I figured it out. Some templates are resolved on
9.5_plus etc.

On Mon, Jan 23, 2017 at 3:31 PM, Atira Odhner <aodhner(at)pivotal(dot)io> wrote:

> 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
>
>

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2017-01-24 09:43:17 Re: Acceptance Tests against a browser (WIP)
Previous Message Atira Odhner 2017-01-23 20:31:51 inconsistent sql template path resolving