Re: Patch: Auto-generate search_path statement for selected schema in query editor

From: Florian Klaar <flo(dot)klaar(at)gmx(dot)de>
To: Dave Page <dpage(at)pgadmin(dot)org>
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-11 20:22:27
Message-ID: 51195303.8090901@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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"))
schemaName = obj->GetName();
else if (obj->GetSchema())
schemaName = obj->GetSchema()->GetName();
if(!schemaName.IsEmpty())
{
// the works...
}

Much better. Thanks for your input.

Florian

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Kari Karkkainen 2013-02-17 20:21:03 Detecting mouse events in the SQL grid
Previous Message Florian Klaar 2013-02-11 16:38:32 Re: Patch: Auto-generate search_path statement for selected schema in query editor