From: | Dave Page <dpage(at)pgadmin(dot)org> |
---|---|
To: | Florian Klaar <flo(dot)klaar(at)gmx(dot)de> |
Cc: | pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org> |
Subject: | Re: Patch: Auto-generate search_path statement for selected schema in query editor |
Date: | 2013-02-18 15:41:30 |
Message-ID: | CA+OCxoxacfky7Qdb2fRRv8HMpz6rG-gvT6c4XNwkJ09J2LGPBg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
On Mon, Feb 11, 2013 at 8:22 PM, Florian Klaar <flo(dot)klaar(at)gmx(dot)de> wrote:
> Hey,
>
> > You're missing something - specifically that GetSchema is declared as
> > a virtual function. That's done so you can do exactly what I'm proposing.
> Now i've tested it again and of course you were right, just my testing
> was flawed. Probably I tested by selecting a schema and opening the
> query window, not taking into account that your example code only works
> below the schema level of course.
> So I've boiled it down to this now:
>
> wxString schemaName;
> if(obj->GetTypeName() == wxT("Schema"))
>
if (obj->GetMetaType() == PGM_SCHEMA)
...
...
> schemaName = obj->GetName();
> else if (obj->GetSchema())
> schemaName = obj->GetSchema()->GetName();
> if(!schemaName.IsEmpty())
> {
> // the works...
> }
>
> Much better. Thanks for your input.
>
> Florian
>
>
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Florian Klaar | 2013-02-18 23:10:43 | Re: Patch: Auto-generate search_path statement for selected schema in query editor |
Previous Message | Dave Page | 2013-02-18 15:39:36 | Re: Patch: Auto-generate search_path statement for selected schema in query editor |