Обсуждение: import: source code is pushed to git repository
hi all I pushed import 's source code to: git://git.postgresql.org/git/users/quan74/pgadmin-import.git web: http://git.postgresql.org/gitweb?p=users/quan74/pgadmin-import.git;a=summary To suport ODBC, please define preprocessor __WITHODBC3__. Under *nix, __WITHIODBC__ or __WITHUNIXODBC is needed. Archive file: Only zip and tar file is supported. All of them only tested under WindowsXP. Regards. ----------------------------------------------- Quan Zongliang quanzongliang@gmail.com
On Sun, Dec 20, 2009 at 9:10 AM, Quan Zongliang <quanzongliang@gmail.com> wrote: > hi all > > I pushed import 's source code to: > git://git.postgresql.org/git/users/quan74/pgadmin-import.git > > web: > http://git.postgresql.org/gitweb?p=users/quan74/pgadmin-import.git;a=summary > > To suport ODBC, please define preprocessor __WITHODBC3__. > Under *nix, __WITHIODBC__ or __WITHUNIXODBC is needed. > > Archive file: Only zip and tar file is supported. > > All of them only tested under WindowsXP. Not so good on Mac yet :-( g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/pgsql/include -DSSL -I/usr/local/lib/wx/include/mac-unicode-release-static-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXMAC__ -O2 -DEMBED_XRC -no-cpp-precomp -arch ppc -arch i386 -I/usr/local//include/libxml2 -I/usr/local/include -I/usr/local//include/libxml2 -Wall -Wno-non-virtual-dtor -fno-strict-aliasing -I../pgadmin/include -c -o frmMain.o `test -f './frm/frmMain.cpp' || echo './'`./frm/frmMain.cpp In file included from ./frm/frmMain.cpp:61: ../pgadmin/include/frm/frmImport.h:118: error: ‘wxSpinEvent’ has not been declared In file included from ./frm/frmMain.cpp:61: ../pgadmin/include/frm/frmImport.h:118: error: ‘wxSpinEvent’ has not been declared lipo: can't figure out the architecture type of: /var/folders/wn/wnM76L9ZF6agsFkWcNv6pk+++TI/-Tmp-//ccBdhNrR.out make[2]: *** [frmMain.o] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Seems like oyu need to add <wx/spinctrl.h> to frmImport.h. <continuing with build now...> -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
On Tue, Dec 22, 2009 at 9:08 PM, Dave Page <dpage@pgadmin.org> wrote: >> All of them only tested under WindowsXP. > > Not so good on Mac yet :-( > ... > Seems like oyu need to add <wx/spinctrl.h> to frmImport.h. > > <continuing with build now...> OK, got it to the link phase with the attached patch, but then it died horribly. I think you need to build your code under gcc every now and again, to keep it in a nice cross-platform friendly state. It's also a good idea to catch any problems - gcc tends to be a much less forgiving compiler than VC++, which will often allow code which will crash elsewhere (for example, passing wxStrings through variadic functions such as on line 4304 of frmImport.cpp). If you don't have a Linux box, I'd suggest grabbing a copy of VirtualBox for Windows, and installing Ubuntu or Fedora in it. g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/pgsql/include -DSSL -I/usr/local/lib/wx/include/mac-unicode-release-static-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXMAC__ -O2 -DEMBED_XRC -no-cpp-precomp -arch ppc -arch i386 -I/usr/local//include/libxml2 -I/usr/local/include -I/usr/local//include/libxml2 -Wall -Wno-non-virtual-dtor -fno-strict-aliasing -I../pgadmin/include -c -o frmImport.o `test -f './frm/frmImport.cpp' || echo './'`./frm/frmImport.cpp In file included from ./frm/frmImport.cpp:7: ../pgadmin/include/frm/frmImport.h:67: error: ‘pgTable’ has not been declared ../pgadmin/include/frm/frmImport.h:210: error: ISO C++ forbids declaration of ‘pgTable’ with no type ../pgadmin/include/frm/frmImport.h:210: error: expected ‘;’ before ‘*’ token ./frm/frmImport.cpp:309: error: ‘pgTable’ has not been declared ./frm/frmImport.cpp: In constructor ‘frmImport::frmImport(frmMain*, int*)’: ./frm/frmImport.cpp:312: error: ‘m_table’ was not declared in this scope ./frm/frmImport.cpp: In member function ‘void frmImport::Init()’: ./frm/frmImport.cpp:381: error: ‘m_table’ was not declared in this scope ./frm/frmImport.cpp:390: error: no matching function for call to ‘wxXmlResource::LoadObject(frmImport* const, frmMain*&, const wchar_t [10], const wchar_t [9])’ /usr/local/include/wx-2.8/wx/xrc/xmlres.h:201: note: candidates are: wxObject* wxXmlResource::LoadObject(wxWindow*, const wxString&, const wxString&) /usr/local/include/wx-2.8/wx/xrc/xmlres.h:207: note: bool wxXmlResource::LoadObject(wxObject*, wxWindow*, const wxString&, const wxString&) ./frm/frmImport.cpp: In member function ‘void frmImport::OnTextFilePreviewMore(wxCommandEvent&)’: ./frm/frmImport.cpp:823: warning: comparison between signed and unsigned integer expressions ./frm/frmImport.cpp: In member function ‘void frmImport::OnArchFilePathKillFocus(wxFocusEvent&)’: ./frm/frmImport.cpp:854: warning: taking address of temporary ./frm/frmImport.cpp: In member function ‘void frmImport::OnArchFilePreviewMore(wxCommandEvent&)’: ./frm/frmImport.cpp:911: warning: comparison between signed and unsigned integer expressions ./frm/frmImport.cpp: In member function ‘void frmImport::OnColSettingCellChange(wxGridEvent&)’: ./frm/frmImport.cpp:1268: warning: unused variable ‘evcolnr’ ./frm/frmImport.cpp: In member function ‘void frmImport::ImportData()’: ./frm/frmImport.cpp:2228: error: ‘_itow’ was not declared in this scope ./frm/frmImport.cpp:2354: error: ‘_itow’ was not declared in this scope ./frm/frmImport.cpp:2592: error: ‘_itow’ was not declared in this scope ./frm/frmImport.cpp:2814: error: ‘_itow’ was not declared in this scope ./frm/frmImport.cpp:1470: warning: unused variable ‘logwarn’ ./frm/frmImport.cpp: In member function ‘void frmImport::GenColsPreview()’: ./frm/frmImport.cpp:3857: error: ‘_itow’ was not declared in this scope ./frm/frmImport.cpp:3882: error: ‘_itow’ was not declared in this scope ./frm/frmImport.cpp:3781: warning: unused variable ‘skipemptyline’ ./frm/frmImport.cpp:4056: error: ‘_itow’ was not declared in this scope ./frm/frmImport.cpp:3426: warning: unused variable ‘errcount’ ./frm/frmImport.cpp: In member function ‘bool frmImport::GenCSVSQLData(wxString&, wxString&, wxString**, size_t, wxDateTime&, int, int)’: ./frm/frmImport.cpp:4304: warning: cannot pass objects of non-POD type ‘class wxString’ through ‘...’; call will abort at runtime ./frm/frmImport.cpp:4196: warning: unused variable ‘pvgridrowidx’ ./frm/frmImport.cpp: In member function ‘void frmImport::InitWizardPage(frmImport::WizardPageNumber)’: ./frm/frmImport.cpp:4869: warning: enumeration value ‘INVALIDPAGE’ not handled in switch ./frm/frmImport.cpp:4869: warning: enumeration value ‘ALLIMPPAGES’ not handled in switch ./frm/frmImport.cpp:4869: warning: enumeration value ‘TARGETPAGE’ not handled in switch ./frm/frmImport.cpp:4869: warning: enumeration value ‘SRCTYPEPAGE’ not handled in switch ./frm/frmImport.cpp:4869: warning: enumeration value ‘SRCODBCPAGE’ not handled in switch ./frm/frmImport.cpp:4869: warning: enumeration value ‘COLSETTINGPAGE’ not handled in switch ./frm/frmImport.cpp:4869: warning: enumeration value ‘DESTLOGPAGE’ not handled in switch ./frm/frmImport.cpp: In member function ‘void frmImport::ResetWizardPage(frmImport::WizardPageNumber)’: ./frm/frmImport.cpp:5001: warning: enumeration value ‘INVALIDPAGE’ not handled in switch ./frm/frmImport.cpp:5001: warning: enumeration value ‘ALLIMPPAGES’ not handled in switch ./frm/frmImport.cpp:5001: warning: enumeration value ‘TARGETPAGE’ not handled in switch ./frm/frmImport.cpp:5001: warning: enumeration value ‘SRCTYPEPAGE’ not handled in switch ./frm/frmImport.cpp:5001: warning: enumeration value ‘SRCODBCPAGE’ not handled in switch ./frm/frmImport.cpp:5001: warning: enumeration value ‘COLSETTINGPAGE’ not handled in switch ./frm/frmImport.cpp:5001: warning: enumeration value ‘PROCESSPAGE’ not handled in switch ./frm/frmImport.cpp: In member function ‘void frmImport::ResetColSettingPage()’: ./frm/frmImport.cpp:5446: error: expected `}' before ‘else’ ./frm/frmImport.cpp:5446: error: expected `}' before ‘else’ ./frm/frmImport.cpp: At global scope: ./frm/frmImport.cpp:5446: error: expected unqualified-id before ‘else’ ./frm/frmImport.cpp:5449: error: expected declaration before ‘}’ token -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
Вложения
> If you don't have a Linux box, I'd suggest grabbing a copy of > VirtualBox for Windows, and installing Ubuntu or Fedora in it. Yes, it is in my plan. My note-book's memory is too small to run a vm. So I ordered a new memory yesterday. It will be delivered to me tomorrow. ^-^ And, Merry xmas everybody. ----------------------------------------------- Quan Zongliang quanzongliang@gmail.com
On Wed, Dec 23, 2009 at 1:26 PM, Quan Zongliang <quanzongliang@gmail.com> wrote: >> If you don't have a Linux box, I'd suggest grabbing a copy of >> VirtualBox for Windows, and installing Ubuntu or Fedora in it. > Yes, it is in my plan. > > My note-book's memory is too small to run a vm. > So I ordered a new memory yesterday. > It will be delivered to me tomorrow. > ^-^ > > And, Merry xmas everybody. And to you :-) -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
> If you don't have a Linux box, I'd suggest grabbing a copy of > VirtualBox for Windows, and installing Ubuntu or Fedora in it. It can work now. CSV ZIP and TAR files can be imported. ODBC is not ready yet, with a lot of errors. New year holiday is over. I will continue to fix it when I have time off. ----------------------------------------------- Quan Zongliang quanzongliang@gmail.com
On Mon, Jan 4, 2010 at 4:03 AM, Quan Zongliang <quanzongliang@gmail.com> wrote: >> If you don't have a Linux box, I'd suggest grabbing a copy of >> VirtualBox for Windows, and installing Ubuntu or Fedora in it. > > It can work now. CSV ZIP and TAR files can be imported. Cool - I'll give it a try as soon as I can. I'm away next week, and catching up/preparing this week though, so it may not be for a little while. I'd encourage others to give Quan's code a try. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
Le 04/01/2010 10:18, Dave Page a écrit : > On Mon, Jan 4, 2010 at 4:03 AM, Quan Zongliang <quanzongliang@gmail.com> wrote: >>> If you don't have a Linux box, I'd suggest grabbing a copy of >>> VirtualBox for Windows, and installing Ubuntu or Fedora in it. >> >> It can work now. CSV ZIP and TAR files can be imported. > > Cool - I'll give it a try as soon as I can. I'm away next week, and > catching up/preparing this week though, so it may not be for a little > while. > > I'd encourage others to give Quan's code a try. > I tried it. I fixed a few warnings I got with gcc. I fixed also the installation of frmImport.xrc. The patch is attached. Unfortunately, I didn't fix all warnings. Here are the ones still there: ./frm/frmImport.cpp: In member function ‘void frmImport::OnArchFilePathKillFocus(wxFocusEvent&)’: ./frm/frmImport.cpp:841: warning: taking address of temporary ./frm/frmImport.cpp: In member function ‘void frmImport::ImportData()’: ./frm/frmImport.cpp:1458: warning: unused variable ‘logwarn’ ./frm/frmImport.cpp: In member function ‘void frmImport::GenColsPreview()’: ./frm/frmImport.cpp:3779: warning: unused variable ‘skipemptyline’ ./frm/frmImport.cpp:3421: warning: unused variable ‘errcount’ ./frm/frmImport.cpp: In member function ‘bool frmImport::GenCSVSQLData(wxString&, wxString&, wxString**, size_t, wxDateTime&, int, int)’: ./frm/frmImport.cpp:4199: warning: unused variable ‘pvgridrowidx’ ./frm/frmImport.cpp: In member function ‘void frmImport::ResetColSettingSrcColEditor(bool)’: ./frm/frmImport.cpp:5516: warning: unused variable ‘firstish’ ./frm/frmImport.cpp: In member function ‘frmImport::exprSnippet* frmImport::ParseImportExpr(const wxString&)’: ./frm/frmImport.cpp:6826: warning: unused variable ‘incoldef’ The vast majority are unused variables. Probably because of a WIP. The only one that really bugs me is: ./frm/frmImport.cpp:841: warning: taking address of temporary I don't see how to fix this. Certainly because I don't understand the warning :/ With all my fixes, I'm able to launch the frmImport window. I load a csv file. When I click Next, it crashes. See the screenshots attached. I don't know why yet. I also attached the csv file, as it could be the culprit. FYI, here is the table definition: CREATE TABLE fbb_bans ( id serial NOT NULL, username character varying(200), ip character varying(255), email character varying(50), message character varying(255), expire integer, CONSTRAINT fbb_bans_pkey PRIMARY KEY (id) ) Any idea on what could be wrong? and what about this strange warning message? -- Guillaume. http://www.postgresqlfr.org http://dalibo.com
Вложения
Sorry for late reply. I bought a new harddisk and reinstalled my OS. It is really a hard work to change hdd with notebook. Good news is I have dual OS(Windows Xp and CentOS). I don't suffer slow vm from now. > I tried it. I fixed a few warnings I got with gcc. I fixed also the > installation of frmImport.xrc. The patch is attached. Thanks. I will apply them to git. > The vast majority are unused variables. Probably because of a WIP. I will fix them. All of them nerver appear under Windows XP. Last week, I just make it can be compiled by gcc without error. ----------------------------------------------- Quan Zongliang quanzongliang@gmail.com