[pgadmin-hackers] query builder / system objects
dave, pga3 question i can tell system columns easily (and hopefully correctly): // We need to know if we're going to show system objects wxString sysobjstr; if (!settings->GetShowSystemObjects()) sysobjstr = " WHERE attnum >= 0 "; but is this an adequate way to check for system tables/views? this is what i'm using now. // We need to know if we're going to show system objects wxString sysobjstr; if (!settings->GetShowSystemObjects()) sysobjstr = " AND relowner >= 1 "; the other way i was going to do it was if the first three letters are "PG_" but maybe you have a more correct way of doing this. -keith ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [pgadmin-hackers] query builder / system objects
correction relowner > 1 instead of >=1 // We need to know if we're going to show system objects wxString sysobjstr; if (!settings->GetShowSystemObjects()) sysobjstr = " AND relowner > 1 "; -Original Message- From: efesar [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 5:18 PM To: pgadmin-hackers Subject: query builder / system objects dave, pga3 question i can tell system columns easily (and hopefully correctly): // We need to know if we're going to show system objects wxString sysobjstr; if (!settings->GetShowSystemObjects()) sysobjstr = " WHERE attnum >= 0 "; but is this an adequate way to check for system tables/views? this is what i'm using now. // We need to know if we're going to show system objects wxString sysobjstr; if (!settings->GetShowSystemObjects()) sysobjstr = " AND relowner >= 1 "; the other way i was going to do it was if the first three letters are "PG_" but maybe you have a more correct way of doing this. -keith ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [pgadmin-hackers] query builder / system objects
sorry, forgot to hit reply to all... = dave, thanks for the advice. in other news, i've got a pretty hefty update coming your way. i've got a rudimentary query builder fully functional. it's got a lot of work yet to come, but i want you to see the executable and tell me what you think. i think it's really cool so far and would like some feedback. a zipped exec is about 1 meg. let me know if you want that emailed to you ... i prefer not to email it to the list since it is quite large. after you see the exec, and if you like where i'm going with the query builder, i can make a patch. i've made a lot of code changes. mostly i added several classes, but i found some bugs that i tweaked in the main code ... the only reason i changed them is because i needed the functionality for my component. also, i added some system settings functions and what not to store the query builder size and position. etc ad nauseum. let me know. thanks again. ps as for the cache ... i'll think on it. i really hadn't even given cache much thought, i'm just running raw queries. i know, that's probably bad. :) -keith -Original Message- From: Dave Page [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 1:56 AM To: efesar; pgadmin-hackers Subject: RE: [pgadmin-hackers] query builder / system objects Hi Keith, This raises a point I'd not thought of before. In pgAdmin II we load all object, system or not into pgSchema. We then just display whatever is required. This allows us to use pgSchema as a cache for future queries - ie. When we look for all functions in the CREATE OPERATOR dialogue, we just load everything from the Functions collection. In pgAdmin III, the hierarchy is built on the treeview, so how do we cache everything in the same way? I have to be honest, I haven't thought about any of this for a while now 'cos I've been too busy, but I might have some time in the next couple of weeks. Anyway, to answer your question, in pgSchema we say (attnum < 1) = System. To check for views and tables, well this is easy now - if they are in the pg_catalog, pg_temp or pg_temp_* schemas, then they are system object. pgAdmin III is being written for 7.3+, so we know schemas will always exist. Regards, Dave. > -Original Message- > From: efesar [mailto:[EMAIL PROTECTED] > Sent: 04 March 2003 00:19 > To: pgadmin-hackers > Subject: Re: [pgadmin-hackers] query builder / system objects > > > correction > > relowner > 1 instead of >=1 > > // We need to know if we're going to show system objects > wxString sysobjstr; > if (!settings->GetShowSystemObjects()) > sysobjstr = " AND relowner > 1 "; > > -Original Message- > From: efesar [mailto:[EMAIL PROTECTED] > Sent: Monday, March 03, 2003 5:18 PM > To: pgadmin-hackers > Subject: query builder / system objects > > > > dave, > > pga3 question > > i can tell system columns easily (and hopefully correctly): > > // We need to know if we're going to show system objects > wxString sysobjstr; > if (!settings->GetShowSystemObjects()) > sysobjstr = " WHERE attnum >= 0 "; > > but is this an adequate way to check for system tables/views? > this is what i'm using now. > > // We need to know if we're going to show system objects > wxString sysobjstr; > if (!settings->GetShowSystemObjects()) > sysobjstr = " AND relowner >= 1 "; > > the other way i was going to do it was if the first three > letters are "PG_" but maybe you have a more correct way of doing this. > > -keith > > > ---(end of > broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to > [EMAIL PROTECTED]) > ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[pgadmin-hackers] PGAdmin 3 Patch
Dave, Here is my patch file (changes and the relevant new files) for PGAdmin3. Basically it's all related to QueryBuilder. -k www.fearstudios.com www.efesar.com www.efesar.com/blog www.burque.info = I've stopped 6,843 spam messages. You can too! Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/ Requirements: * Windows 98 / NT / 2000 / XP * Outlook 2000 / XP pgadmin3.keith.2003.03.zip Description: Zip compressed data ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[pgadmin-hackers] PGAdmin 3 Patch // Memory Leaks Fixed // Ignore last patch
Dave, Nevermind that last patch if you haven't patched it yet. I got seriously bored of looking at memory leaks in VCC so I went through and patched all the memory leaks that I could find. Also, there are a couple of updates on the Query Builder. Here is a synopsis of changes: * Drag/Drop functionality in the Query Builer is not functional yet, so use double clicks/context menus instead. Most of the context/double clicks actually work in the child windows and in the add table/view window. * Added and ExecuteSet to pgDatabase (cloned from pgServer), because using the one from pgServer was choosing random connections/databases. * pgServer::ExecuteSet (and pgDatabase::ExecuteSet) now returns a pointer instead of a reference and has to be deleted when you're done with it (this was the major source of memory leaks because you were converting the pointer into a reference, ergo the references were being deleted, but not the objects themselves) * pgSet::ColName -- column names in PQfname are zero based, not one baseed, so I had changed "col+1" to "col" for consistency. This might also be true of PQfsize, but I didn't check. * Deleted the logger in application OnExit because it was causing memory leaks. * Converted all context menus and the image lists to members of frmMain because they weren't being deleted. Also, deleted them in the destructor (fixing memory leaks in the process). * In the application OnInit, syssettings was calling a log function before the logger was initialized, and the logger requires syssettings, therefore it was causing a memory leak. I had to delete the log entry from syssettings OnInit to prevent memory leak (it wasn't being logged anyway). * frmConnect - it's a modal form, so I turned it into a reference instead of a pointer to prevent memory leaks and also so that you don't have to call destroy or delete. I think it's called in pgConn::OnConnect(). * frmConnect - it's now returning IDOK and IDCANCEL to be more visible. As a side note, I figured out the problem with caching. I can't cache anything yet because the database objects aren't loaded in the treeview (there's no functionality for that yet). So for now, to make the Query Builder functional, I must use raw SQL calls. However, I will build it with the idea in mind that later we will take info from the cache (whatever it's architecture happens to be). As usual, I think you can ignore the project file. Just make sure to add the new cpp/h files in the appropriate places. -Keith pgadmin3.keith.2003.03.zip Description: Zip compressed data ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [pgadmin-hackers] PGAdmin 3 Patch // Memory Leaks Fixed // Ignore last patch
> Nice work, thanks. You must have been bored :-). As you can probably
> tell I'm fairly new to C++ and still get a little confused with
> references & pointers from time to time.
Dave,
I've been programming C++ for years and I consistently have memory leaks --
especially in MFC. The really hard part about MFC is that it only takes
ownership of attached items under certain conditions (and of course since
it's Microsoft code, you never really know when that is). The really *great*
thing about wxWindows is that if you attach something to a window, dialog,
frame or control, it's deallocation is *taken care of* all the time.
> Anyway, I've applied this patch to my copy of the tree, and once I found
> the wx2.4 change you commented (downloading it now), it built OK.
> Unfortunately, I still can't get the QueryBuilder to do anything. When I
> try to add a table there are none listed - I've tried a few databases,
> all of which have a number of tables. I haven't had a chance to figure
> out what's wrong. Also, if I click the Data tab I get a parse error,
> even if I manually type in a valid query (which then vanishes).
I'm really confused as to why it's not showing any tables/views ... the
function is below. As for the SQL tab, it's one way (for now ... which
reminds me, do we have a "deconstruct sql" function lying around?) ... the
data tab calls the BuildSQL function before it gets data ... it can't get
any data unless there are some columns, and columns require tables, and as
you know ... the tables are for some strange reason not working on your
configuration.
I'm running PostgreSQL 7.3 on Cygwin so ... Maybe I misjudged the query.
Take a look at it below.
void dlgAddTableView::InitLists()
{
// We need system settings
extern sysSettings *settings;
// We need to know if we're going to show system objects
wxString sysobjstr;
if (!settings->GetShowSystemObjects())
sysobjstr = " AND relowner > 1 ";
// Clear the lists
m_tablelist->Clear();
m_viewlist->Clear();
if (m_database->Connect() == PGCONN_OK) {
// tables
pgSet *tables = m_database->ExecuteSet(
wxT("SELECT oid,relname FROM pg_class "
"WHERE relkind='r' " + sysobjstr +
"ORDER BY lower(relname)"));
while (!tables->Eof()) {
m_tablelist->Append(tables->GetVal(wxT("relname")));
tables->MoveNext();
}
delete tables;
// views
pgSet *views = m_database->ExecuteSet(
wxT("SELECT relname FROM pg_class "
"WHERE relkind='v' " + sysobjstr +
"ORDER BY lower(relname)"));
while (!views->Eof()) {
m_viewlist->Append(views->GetVal(wxT("relname")));
views->MoveNext();
}
delete views;
}
}
> The one from pgServer should *always* be the master connection (ie. The
> database in the login dialogue). Is this not the case?
Yes, that makes sense now. Since pgServer chooses the master connection, I
added the ExecuteSet command to the pgDatabase so that the user can query
the pgConn member of pgDatabase, which already has the correct database
open. That way I won't have to issue a "change database" command to
pgServer. To be honest, I don't even know how to make pgServer switch
databases.
> On another note, how did you generate the patch? I had a heck of a job
> applying it as it found files in /src but not any of the others. It's
> probably me though - I often end up battling with patch
I'm using this program called TortoiseCVS. I can't get WinCVS to work to
save my life. Tortoise works pretty well, but I have no idea how patches
work for the most part. I just click "Make Patch" ... Since there were 6
files that were not in CVS, I zipped them in with the .patch file ... but
didn't put them into any particular subdirectories. If you have suggestions
on how to make better patches, I'll try em.
I found this document in the wxwindows domain:
http://www.wxwindows.org/technote/patches.htm
I will draw your attention to item #3: cvs diff cannot make a patch which
adds or removes a file, so you must use the standalone diff utility to do
that ...
Huh? It does my brain no justice to be up this late trying to interpret what
that means.
-Keith
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
[pgadmin-hackers] "identifiers" pga3 patch
Dave, >From the SQL docs (1.1.1): "SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, digits (0-9), or underscores, although the SQL standard will not define a key word that contains digits or starts or ends with an underscore." Do we have a function built yet that checks for this in pga3 yet? If not, I built one and stuck it in the globals. Here are the patches for misc.h and misc.cpp. -Keith pga3.keith.2003.03.zip Description: Zip compressed data ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [pgadmin-hackers] "identifiers" pga3 patch
Dave, PS -- it doesn't check for "diacriticals" or non-latin marks. That's beyond my ability at the moment. -Keith > letter (a-z, but also letters with diacritical marks and > non-Latin letters) > or an underscore (_). Subsequent characters in an identifier or > key word can > be letters, digits (0-9), or underscores, although the SQL > standard will not > define a key word that contains digits or starts or ends with an > underscore." ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [pgadmin-hackers] PGAdmin 3 Patch // Memory Leaks Fixed // Ignore
> > I'm really confused as to why it's not showing any > > tables/views ... the function is below. > > It's because I had System Objects turned off, and as your definition of > a system object is relowner > 1, it ignored all my objects which are > owned by user postgres, id = 1!!! > > What you need to do is discount tables and views if they are in the > pg_catalog, pg_temp_* or pg_toast namespaces, and columns is attnum < 1. Dave, Okay, that change is made. Now I do a join with pg_namespace.oid = pg_class.relnamespace and it looks like it's working. And for columns, I changed attnum >= 0 to attnum > 0 and it works as indicated. It will be functional in the next patch. > > As for the SQL tab, > > it's one way (for now ... which reminds me, do we have a > > "deconstruct sql" function lying around?) > > Umm, no. The closest we have is in the query tool in pgAdmin II and it's > big, complex and occasionally falls over. Perhaps we can steal some of > the PostgreSQL parser code for pgAdmin III? I know nothing about how > that works though. Yeah, that might be possible, but it will take some work. I did some cursory investigation, and a lot of function names and defines in pgsql conflict with the MS and wxWindows libraries. For right now I'm just building a small regex doodad to split everything up. It's working pretty well. Unfortunately the regex library that comes with WX is POSIX instead of PCRE. Oh well, I know both syntaxes, I'm just much more familiar with PCRE. For now I will make the SQL box read-only. I know there are other solutions, but are too costly to implement right now. > Anyway, now it does some things here, it looks excellent - Nice work!! Thanks. The next patch will add tons of functionality. At this point it can create 85% of the queries you'd ever build. > > I'm using this program called TortoiseCVS. I can't get WinCVS > > to work to save my life. > > Funny that, I could never get TortoiseCVS to work! Okay, I added certain files to .cvsignore ... hopefully the patches work better now. -Keith ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [pgadmin-hackers] "identifiers" pga3 patch
> The closest we have is a function to check whether we should quote an > identifier, so I've added this one. Not knowing what a diacritical is, > checking for one is beyond me as well :-) It'll be a "feature" not a bug! :) > Anyway, I've added your patch, and also committed it and your previous > work to CVS. It needs work obviously, but is a promising enough start to > warrant committing it in an incomplete state I think. Thanks. I should have a patch for you soon. It's quite functional now. (((gets excited))) It might be a week or two before the next patch. I got a contract job to build a pretty huge database. I know databases pretty well (Paradox, Access, MS-SQL, MySQL, PGSQL), but thanks to PGA3 I understand the intricacies of PG7.3 better than ever. -Keith ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [pgadmin-hackers] Non-debug pgAdmin III builds
> If you do a release build of pgAdmin III in VC++, does it crash horribly > on your system? In previous versions of wxWindows, I found it crashed > when leaving one particular function (for absolutely no reason that I > could find - it was literally on the closing brace!). I tried it again > today with wx 2.4.0, and now it seems to crash on any treeview > selection. Dave, Do you mean the build crashes or the program crashes once it's built? If you mean the build crashes (i.e., won't link) -- Make sure to load up wxWindows.DSW and build the release version of wxWindows. Also, build the release versions of STC and XRC (those are both in the contrib directory I believe). When I had those three libs built, everything worked fine. I can't get it to crash at all, but I didn't do a super-thorough test, just cursory. Where is yours crashing? One thing -- I don't have two different builds for libpq.lib (just one for both release and debug). And it might be a pretty old build -- in fact, the last time I built it was on Dec 9, 2002. -Keith ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [pgadmin-hackers] Non-debug pgAdmin III builds
Dave, > It's a program crash, whenever a treeview item is clicked (right or > left). I don't have any crashes on the treeview. I would say clean everything, and rebuild everything. > I also have one libpq, from 29th October (7.3dev), but it crashes > before anything in that gets called anyway. I've attached mine (zipped). Based on what you say, that probably won't help but it might. Oh, BTW, I'm running SP5 on Visual C 6.0. What are you running? Maybe that makes a difference. And what is your OS? -Keith libpq.zip Description: Zip compressed data ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[pgadmin-hackers] can't compile
Dave, I thought of one other thing ... I'm using MSVC Standard ... are you using the Pro version? Maybe there is something in global options, or some kind of compiler optimization. Since VC standard doesn't do compiler optimizations, it's possible that there's a bad optimization set for compilation on pro. ANyway, just a thought. Please keep me updated as to how things go on that side. -Keith ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [pgadmin-hackers] can't compile
Dave, Sorry, I don't know how I missed this. I might be getting .NET Studio Professional, and hopefully I will be able to reproduce at least part of the problem. My compiler switches: C++: /nologo /MD /W3 /GX /O2 /Ob2 /I "include/" /I "c:/wxWindows_2.4.0/include" /I "c:/wxWindows_2.4.0/contrib/include" /I "c:/wxWindows_2.4.0/lib/mswd" /I "c:/postgresql/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FAcs /Fa"Release/" /FR"Release/" /Fo"Release/" /Fd"Release/" /FD /c Linker: kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw.lib png.lib zlib.lib jpeg.lib tiff.lib stc.lib libpq.lib wxxrc.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/pgAdmin3.pdb" /map:"Release/pgAdmin3.map" /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/pgAdmin3.exe" /libpath:"c:/wxWindows_2.4.0/lib" /libpath:"c:/wxWindows_2.4.0/contrib/lib" /libpath:"c:/postgresql/lib" Resources: /l 0x809 /fo"Release/pgAdmin3.res" /i "c:/wxWindows_2.4.0/include" /i "c:/wxWindows_2.4.0/contrib/include" /d "NDEBUG" MIDL: /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 Browse Info: /nologo /o"Release/pgAdmin3.bsc" Custom/Prelink/Postbuild: nothing -Keith > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Dave Page > Sent: Friday, March 21, 2003 12:46 PM > To: efesar; Pgadmin-Hackers > Subject: Re: [pgadmin-hackers] can't compile > > > > > > -Original Message- > > From: efesar [mailto:[EMAIL PROTECTED] > > Sent: 21 March 2003 18:11 > > To: Dave Page; Pgadmin-Hackers > > Subject: can't compile > > > > > > Dave, > > > > I thought of one other thing ... I'm using MSVC Standard ... > > are you using the Pro version? Maybe there is something in > > global options, or some kind of compiler optimization. Since > > VC standard doesn't do compiler optimizations, it's possible > > that there's a bad optimization set for compilation on pro. > > > > ANyway, just a thought. Please keep me updated as to how > > things go on that side. > > Hmm, that is a thought as I'm using Enterprise. What are your compiler > and linker flags? > > Regards, Dave. > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
[pgadmin-hackers] pga3 todo
Dave, Speaking of the TODO list. Can you add me into the TODO for the Query Builder? PS, it's nice to see new people helping out with PGA3. I know several people who are looking forward to this tool when it's done. -Keith ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [pgadmin-hackers] pgadmin3 query tools
> > Sadly, I'm suffering from a complete lack of desire > > concerning a query > > builder... ;-) > > No problem, I just don't want 2 seperate query tools. > > Keith, what are your thoughts? Dave, I have a lot so I'm going to number these. 1. I just got time to try this build. There is a new bug where if it can't connect to the server it goes into an infinite loop (ok, ok, ok, ok, etc. -- for instance, if the server is not running). Starting the server does not help, you have to kill the PGA3 process. Then restart PGA3. 2. Andreas, thank you for fleshing out the tree. I believe we can use that as a cache. Your additions look great so far. Can you let us know which tree items are missing? It looks like foreign keys might be missing. Languages, functions, operators. We also seem to be missing some of the system objects (such as pg_toast, pg_catalog). 3. Andreas' query tool is similar to the old one from PGA2 ... type the query and it runs. I think that's useful for now. 4. However, I would like to continue to code my Query Builder if that's okay with the both of you. I've done quite a bit of work on it. It's visual, and has more functionality and usefulness than the MS Query tool. Mine will allow unions and extremely complex queries. What we can do is maybe integrate the two at some later time so that you can type free-hand queries into my query builder and get the result. As you know, I made the SQL text box read only for the moment. 5. Andreas, I am REALLY REALLY really happy that you used a structured style for SQL reconstruction. PGA2 was unreadable because it was all on one line. But you might consider using a fixed font so that the tabs line up. 6. Please let me know when this is in CVS. I imagine it will be hard to reconcile the two builds. Andreas did a lot of work and I imagine he started before the memory leak fix. So those are my thoughts. -Keith ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [pgadmin-hackers] pgadmin3 query tools
Dave, > 'scuse me!! What's wrong with pga2's output? It's multiline - I take > great care to format it nicely in fact... My bad. I was looking at PGA2 and I realized my mistake. Views are not structured ... Which I realize now is also true of PGA3. Are they stored that way in the database? Is there anyway we can structure them? The reason I ask is because I have some monster views and it's almost impossible to read them if they aren't structured. Sorry about that. -Keith ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [pgadmin-hackers] pgadmin3 query tools
> > 1. I just got time to try this build. There is a new bug > > where if it can't connect to the server it goes into an > > infinite loop (ok, ok, ok, ok, etc. -- for instance, if the > > server is not running). Starting the server does not help, > > you have to kill the PGA3 process. Then restart PGA3. > > Yes, I noticed that as well. Submitting patch for that. > I've been thinking about that, and the majority of places we use such > info, we only need to oid & identifier. I wonder if it would be easier > to build some fast, dedicated caches for that instead. We do acctually > have some of these internally in pgSchema (pga2), but in this code they > could be globally accessible within a pgDatabase. There are pros/cons. The tree is slower than a dedicated cache, but the dedicated cache would have to be refreshed in the same refreshes as the tree. And it would basically end up being a linked list, so we might end up doing double duty. > Done (cvs currently at 193.195.77.163). I believe Andreas did get your > memory fixes in, but please check. Okay, updated and compiled. No memory leaks as far as I can see. -Keith frmMain.cpp.patch Description: Binary data ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [pgadmin-hackers] pgadmin3 query tools
> Keith, are you happy to look at moving the QB onto Andreas' query form, > or does that create problems/worries? Dave, The Query Builder is based on an MDI Parent/Child structure. The parent is a frame, so I don't think it can be bound to any other windows. So that might be a problem. We might consider going the opposite way, and I can add the icons and functionality of the query tool to the Query Builder. Don't know for sure, let me know if you have ideas there. -Keith ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [pgadmin-hackers] pgadmin3 query tools
> Uh, I hate MDI. You're using it at the moment to keep tables and views, > and MDI looks quite reasonable for this (actually, the first time MDI > looks good for me). I don't see how the sql input field should be > assembled into the existing query builder, unless the second notebook > page is used; I really wouldn't like that. Actually, I INSIST that the > query window as it is now (on top query, below result) is somehow > retained. Explicitely I don't like the edit window to become a MDI > child. I'll sound quite harsh about this, but this part of pgadmin2 was > the trigger for me to jump into pgadmin3, and if that feature is spoiled > or degraded I'll be really upset. The only thing that is MDI is the table/view windows, and that should remain true. I dislike MDI as well, and I wanted to avoid it. However, it was the easiest way to do what was necessary. To build clipped frames in a similar manner seems like unnecessary effort. The reason I would like to build my own Pseudo-MDI class (in the future) is to avoid the uncustomizable MDI framework in wxWindows. Here are my two cents. We put a "view" menu in BOTH our tools. It will either have a checkmark on Query Builder or on Query Analyzer (or the preferred name, of course). When in the Query Builder, if they check on Query Analyzer, it will close itself and open your tool. Vice versa in your tool. And we can share window placement. We can even work on merging them into one class, since wxMDIParentFrame is derived from wxFrame. That's just a consideration. I'd like your feedback and Dave's as well. BTW, this paragraph refers to "some later date" after I have a nearly functional Query Builder. It would be too easy for conflicts to develop if we merge them now. For now I'm simply going to duplicate your menus and methods and icons. > Nevertheless, there are other ways. I can think of an additional window > (some kind of assistant, as MS would call it), that can be opened, and > which will inject the query into the query execution window (directly > executing or pasted into the editor). > Another way would be to extract the lower part (notebook, listview and > messages) into an isolated control, making it reusable Then we would > have two query tools, targeted to quite different users. To hide this > fact, the used sql tool could be selected from "options" > (standard/advanced). I believe Dave wants to avoid two tools. See merge idea from previous paragraph with the "view" menu option. I have no problem with putting the QB tabs at the bottom. The only reason I put them at the top is simple negligence. In fact, I'm changing that as we speak and will be in my next CVS update. > (btw keith: checking for relowner > 1 in dlgAddTableView will hide all > my tables... check for system namespace instead) That's old code. It's been namespaced for more than a month. In any case, we're still working on the object caching solution, so direct DB queries are a temporary workaround. BTW, I finally did come across some memory leaks in the additional tree code. I haven't pinpointed them yet, but it looks like some database object is not being deleted after it's allocated. I'll try to do more testing to get further data on the memory leaks to you. -Keith ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [pgadmin-hackers] pgadmin3 query tools
Andreas, > >That's old code. It's been namespaced for more than a month. > > I just committed the changes that deal with that. Go ahead and update. Also there is a bit more functionality on the QueryBuilder. I'll be spending most of the day finishing up what I started. It should be mostly done by the end of today (unless the coffee wears off). > Look at pgTable::GetSql(), there I browse, force pgCollections to > populate and update pgColumns. It's easy, and could be done from > PG_TABLES as well. > Calling ShowTreeDetails(browser,0,0,0,0) has virtually no cost after the > first call. Good to know. > That's totally impossible. A long time ago, I decided to write error > free code. Since then, my code has been proven to be complete, precise, > delicious, juicy, absolutely genious and defect free. > Well, almost... ;-) :) It must have a been some M*cr*s*ft conspirator. > Just tell me where you find something. And I'll find out who's at my > machine adding that leaks while I'm off-site. Just reviewed all > ExecuteSet and found two missing pgSet deletes in pgColumn and > pgSequence. I can't find them now, so I'm guessing the missing deletes cleared them up. -Keith ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[pgadmin-hackers] PGA3 Operator Question
Dave et al, * This is a temporary solution until the cache is built. I need to get a list of operators from the database that will return only booleans types, not integer types. This is basically a list of possible "join" operators. This is the query I've found works the best. Do namespaces matter here? Can anybody suggest a better query? SELECT DISTINCT a.oprname FROM pg_operator a JOIN pg_type b on ( a.oprresult = b.oid ) WHERE a.oprkind = 'b' and b.typname = 'bool' ORDER BY a.oprname -Keith ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[pgadmin-hackers] compiled pga3
Okay, this is my first post so ... go easy on me. I got PGA3 to compile (VCC6) in both Release and Debug mode. I'm using the latest CVS for libpg ... unfortunately wxWindows 2.3.3 was not available so I got 2.3.4 instead. Is that OK? All my development/production databases are PG 7.2. I don't have an extra box to put 7.3 on, and I can't upgrade until such a time as my ISP decides they want to do it. Is there a test server sitting out there in the ether? One thing I did notice I had to change in the project settings for the Debug PGA3 ... it was linked to "wxxrc.lib" and it would give link errors (double defined symbols) until I changed it to "wxxrcd.lib" ... I did not upload the changed DSP because frankly ... I don't know how ... I tried to commit the file but I don't have write access to the repository. Please feel free to ask me questions or assign tasks or whatnot. Thanks. -Keith ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[pgadmin-hackers] regex 4 pga3
I'm surprised how easily I've slipped into wxWindows ... it's like MFC, but a little more intuitive. Consequently, I've done a lot of work done on the Query Builder doodad I'm building. To progress, I need/want regular expressions ... I noticed there is a regex library included with wxWindows (although there doesn't appear to be any documentation for it). Does anybody have experience with this regex library? Does anybody have a preference which one I link to? If not, I'm just going to link to that one and give it whack. Thanks, Keith ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
