Re: [pgadmin-hackers] reindex action

2003-03-06 Thread frank_lupo
 
 
  -Original Message-
  From: frank_lupo [mailto:[EMAIL PROTECTED] 
  Sent: 05 March 2003 21:13
  To: pgadmin-hackers
  Subject: [pgadmin-hackers] reindex action
  
  
  I developed a reindex command (table,index no database).
 
 Sorry Frank - this breaks the OO design of pgSchema. Unless there are
 exceptional circumstances, anything that occurs to an object should be
 implemented as a method of that object, so I would expect to see methods
 like:
 
 pgIndex.ReIndex()
 pgDatabase.ReIndex()
 pgTable.ReIndex()
 
 Can you recode it in that fashion please?
 
 Thanks, Dave.
 

Excuse, I have corrected the schema. 
How we make to call these actions?  

Bye !!
Frank Lupo (Wolf) !!

/\_ _/\
\ o o /
--ooo-ooo---


--
Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f

Sponsor:
Stai cercando una casella di posta professionale senza pubblicità e senza scadenza? 
Quello che fa per te è Email.it Pro15 o Pro50, ordinala subito, è proprio forte!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1045d=6-3

pgDatabase.cls
Description: Binary data


pgIndex.cls
Description: Binary data


pgTable.cls
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] reindex action

2003-03-06 Thread Dave Page


 -Original Message-
 From: frank_lupo [mailto:[EMAIL PROTECTED] 
 Sent: 06 March 2003 14:41
 To: Dave Page
 Cc: pgadmin-hackers
 Subject: Re: [pgadmin-hackers] reindex action
 
 
  
  
   -Original Message-
   From: frank_lupo [mailto:[EMAIL PROTECTED]
   Sent: 05 March 2003 21:13
   To: pgadmin-hackers
   Subject: [pgadmin-hackers] reindex action
   
   
   I developed a reindex command (table,index no database).
  
  Sorry Frank - this breaks the OO design of pgSchema. Unless 
 there are 
  exceptional circumstances, anything that occurs to an 
 object should be 
  implemented as a method of that object, so I would expect to see 
  methods
  like:
  
  pgIndex.ReIndex()
  pgDatabase.ReIndex()
  pgTable.ReIndex()
  
  Can you recode it in that fashion please?
  
  Thanks, Dave.
  
 
 Excuse, I have corrected the schema. 

Looks good.

 How we make to call these actions?  

In basActions.bas, you need a Reindex() sub which will be similar to
Drop(). In there, check the object type, and if appropriate call the
reindex method eg:

ctx.CurrentObject.ReIndex

In clsContext, there needs to be code to enable/disable the reindex
option in Property Set CurrentObject/CurrentDB.

Regards, Dave.

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Re: [pgadmin-hackers] PGAdmin 3 Patch // Memory Leaks Fixed // Ignore last patch

2003-03-06 Thread efesar

 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