Thread: hacking on Beta 1.6 - scratch pad is dangerous :)
I am sooo impressed with this new release! And that scratch pad is a really helpfull addition, I fell in love with it.<br/><br />BUT... that is a dangerous love, I learned. <br /><br />What happened?<br /><br />I constructed a fine query:<br /><br />select md5(array_to_string(array( select md5(id_pkl||id_label || id_lg || name_l||letztespeicherung) fromotlabel where quarant=0 ),''))<br /><br />ran it, got a checksum for a WHOLE table (I was sooo proud of myself :) ...<br /><br />and copied it to the scratch pad.<br /><br />Then, I wanted to test if this checksum really changes when changesare made to the table ... , so I changed the query:<br /><br />select md5(array_to_string(array( select md5(id_pkl||id_label|| id_lg || name_l||letztespeicherung||'pgadmin is great') from otlabel where quarant=0 ),'')) <br /><br/>and pressed F5. Quickly, the interface blinked, and --- the result stayed the same! Wuha?<br /><br />I changed thequery more and more, nearly panicked ... <br /><br />and then learned: hey, I was pressing F5 with focus on the scratchpad. NOTHING was done to my query result :( Of course not --- it's just a scratch pad. <br /><br />So I propose asmall change: as you allready capture F5 and F7 within the scratch pad, at least give a dialog saying something along "ha-ha!nothing happens in the scratch pad" <br /><br />I burned my fingers and learned. Please save others from burning :)<br /><br />Harald<br clear="all" />-- <br />GHUM Harald Massa<br />persuadere et programmare<br />Harald Armin Massa<br/>Reinsburgstraße 202b<br />70197 Stuttgart<br />0173/9409607<br />-<br />Let's set so double the killer delete selectall.
From: Harald Armin Massa [mailto:haraldarminmassa@gmail.com]
Sent: 15 September 2006 09:49
To: Dave Page
Cc: pgadmin-support@postgresql.org
Subject: hacking on Beta 1.6 - scratch pad is dangerous :)I am sooo impressed with this new release! And that scratch pad is a really helpfull addition, I fell in love with it.
BUT... that is a dangerous love, I learned.
What happened?
I constructed a fine query:
select md5(array_to_string(array( select md5(id_pkl||id_label || id_lg || name_l||letztespeicherung) from otlabel where quarant=0 ),''))
ran it, got a checksum for a WHOLE table (I was sooo proud of myself :) ...
:-)
and copied it to the scratch pad.
Then, I wanted to test if this checksum really changes when changes are made to the table ... , so I changed the query:
select md5(array_to_string(array( select md5(id_pkl||id_label || id_lg || name_l||letztespeicherung||'pgadmin is great') from otlabel where quarant=0 ),''))
and pressed F5. Quickly, the interface blinked, and --- the result stayed the same! Wuha?
I changed the query more and more, nearly panicked ...
and then learned: hey, I was pressing F5 with focus on the scratch pad. NOTHING was done to my query result :( Of course not --- it's just a scratch pad.
So I propose a small change: as you allready capture F5 and F7 within the scratch pad, at least give a dialog saying something along "ha-ha! nothing happens in the scratch pad"
What platform? I just tried this on Windows and it works perfectly. The code is also written such that F5 should always execute the query... oh hang on - I don't suppose you had un-docked the scratch pad? If so, it becomes a seperate window controlled by the layout manager. There's no way for me to catch keypresses in that unless I do some *really* funky stuff writing custom versions of each undockable contro for each window. I'm not sure I'd want to though, as F5 in one window really shouldn't affect another anyway, even if it is undocked (imho). That would potentially violate the principle of least surprise.
Regards, Dave.
Dave,
From: Harald Armin Massa [mailto:haraldarminmassa@gmail.com]
Sent: 15 September 2006 12:05
To: Dave Page
Subject: Re: hacking on Beta 1.6 - scratch pad is dangerous :)and then learned: hey, I was pressing F5 with focus on the scratch pad. NOTHING was done to my query result :( Of course not --- it's just a scratch pad.What platform? I just tried this on Windows and it works perfectly. The code is also written such that F5 should always execute the query... oh hang on
Yeah. It does. I keeped on trying, what is going wrong ...
I undocked and redocked the scratch pad, so it was over the whole horizontal area. And: Pressing F5 really executed the query. And, correctly, it executed the query within the query window. Just as designed and correct.That would potentially violate the principle of least surprise.
It was clearly my mistake: I edited within the scratch pad. Of course, that did not lead to a new query.
I learned it and propably will not make this error again... but I am thinking hard of a way to save other from dropping in the same traps :9
Oh well, never mind :-)
Keep the feedback coming though!
/D