Patch: database version check
Patch: database version check
Hi, Dave
very simple patch:
pgAdmin3.h
+const short SERVER_MAX_VERSION = 0x0805;//Exclusive
pgServer.cpp
+ if (conn->BackendMinimumVersion(SERVER_MAX_VERSION >> 8, SERVER_MAX_VERSION & 0x00FF))
+ wxMessageBox(_("Connected to newer database using old version pgAdmin, some function could not run properly.\nUpgrade is recommended."));
+
I had tried to define a new class pgCheckBoxEntryDialog, but
it make pgAdmin's process always live after close.
I'm not familiar about it. First, make a tiny patch.
It's not needed to define a new function to check version.
So, define a exclusive version: SERVER_MAX_VERSION.
Before commit, don't forget to modify message text.
-----------------------------------------------
Quan Zongliang
quanzongliang@gmail.com
CIT Japan: http://www.cit.co.jp
CIT China: http://www.citbj.com.cn
Re: Patch: database version check
От:
"Dave Page" <dpage@pgadmin.org>
Дата:
On Tue, Jan 13, 2009 at 9:25 AM, Quan Zongliang wrote:
> Hi, Dave
>
> very simple patch:
>
> pgAdmin3.h
> +const short SERVER_MAX_VERSION = 0x0805;//Exclusive
>
> pgServer.cpp
>
> + if (conn->BackendMinimumVersion(SERVER_MAX_VERSION >> 8, SERVER_MAX_VERSION & 0x00FF))
> + wxMessageBox(_("Connected to newer database using old version pgAdmin, some function could not run properly.\nUpgrade is recommended."));
> +
Without the whole patch it's somewhat tricky to apply :-p
I've manually hacked up something roughly equivalent and committed it.
--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
Re: Patch: database version check
От:
Quan Zongliang <quanzongliang@gmail.com>
Дата:
> Without the whole patch it's somewhat tricky to apply :-p > > I've manually hacked up something roughly equivalent and committed it. The patch file has been attached. But that definition is strange. So I tried to describe it. After thought cursorily, I think minor-version + 1 is wrong. (foolish man -.- ) Thanks for your right patch. BTW: With import function, some base class changed. Two new methods: CanImport and CanExport added to pgObject class. For pgTable, if it has column, both return true. If not, both return false. For pgView, CanImport return false and CanExport return true. As them are base class. Apply them now? ----------------------------------------------- Quan Zongliang quanzongliang@gmail.com CIT Japan: http://www.cit.co.jp CIT China: http://www.citbj.com.cn
Re: Patch: database version check
От:
"Dave Page" <dpage@pgadmin.org>
Дата:
On Wed, Jan 14, 2009 at 2:20 AM, Quan Zongliang wrote: > BTW: > With import function, some base class changed. > Two new methods: CanImport and CanExport added to pgObject class. > For pgTable, if it has column, both return true. If not, both return false. > For pgView, CanImport return false and CanExport return true. > > As them are base class. Apply them now? Do you expect to have the whole patch ready in the next 2 or 3 weeks? If not, I'd rather wait until after we branch 1.10. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com