Thread: Problem w Favourites menu
<div class="WordSection1"><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Verdana","sans-serif"">WhenI select Favourites, Add from the query window menu, and I enter a favouritesname which contains spaces, I almost always get a fatal error message from Windows 7. The image (and text) ofthe error message is below.</span><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Verdana","sans-serif"">WhenI restart pgAdmin, the favourite has been added (with spaces.)</span><p class="MsoNormal"style="margin-bottom:12.0pt"><span style="font-family:"Verdana","sans-serif"">If I then try to add anotherfavourite (with spaces in the name,) the same thing happens.</span><p class="MsoNormal" style="margin-bottom:12.0pt"><spanstyle="font-family:"Verdana","sans-serif"">The problem appears to persist until I use theFavourites Manage tool, edit the offending favourite name, and save it. Then, the issue goes away, but ONLY for the currentsession. If I close and restart pgAdmin, the issue is back again.</span><p class="MsoNormal" style="margin-bottom:12.0pt"><spanstyle="font-family:"Verdana","sans-serif"">Thanks for a great tool – this is the firsttime I’ve had a reason to report an issue, and I’ve been using the tool since pg version 7.3</span><p class="MsoNormal"style="margin-bottom:12.0pt"><span style="font-family:"Verdana","sans-serif";color:#1F497D">Lou O’Quin</span><pclass="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#1F497D">************************************************************************************************</span><p class="MsoNormal"style="margin-bottom:12.0pt"><span style="font-family:"Verdana","sans-serif"">Pg Version string PostgreSQL 9.2.3, compiled by Visual C++ build 1600, 32-bit (local to PC)</span><p class="MsoNormal" style="margin-bottom:12.0pt"><spanstyle="font-family:"Verdana","sans-serif"">pgAdmin III Version 1.16.1(Feb 5 2013, rev:REL-1_16_1)</span><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Verdana","sans-serif"">O/S Windows 7 Enterprise Service Pack 1</span><pclass="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Verdana","sans-serif";color:#1F497D">*****************************************************************************</span><span style="font-family:"Verdana","sans-serif""></span><pclass="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"CourierNew"">pgAdmin III - PostgreSQL Tools</span><p class="MsoNormal" style="margin-bottom:12.0pt"><spanstyle="font-family:"Courier New"">pgAdmin III - PostgreSQL Tools has stopped working</span><pclass="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Courier New"">A problem caused theprogram to stop working correctly. Windows will close the program and notify you if a solution is available.</span><pclass="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-family:"Verdana","sans-serif""> </span></b><pclass="MsoNormal" style="margin-bottom:12.0pt"><img height="206"id="Picture_x0020_1" src="cid:image001.png@01CE2617.C9D9F1D0" width="366" /><b><span style="font-family:"Verdana","sans-serif""></span></b><pclass="MsoNormal"> </div>
When I select Favourites, Add from the query window menu, and I enter a favourites name which contains spaces, I almost always get a fatal error message from Windows 7. The image (and text) of the error message is below.
When I restart pgAdmin, the favourite has been added (with spaces.)
If I then try to add another favourite (with spaces in the name,) the same thing happens.
The problem appears to persist until I use the Favourites Manage tool, edit the offending favourite name, and save it. Then, the issue goes away, but ONLY for the current session. If I close and restart pgAdmin, the issue is back again.
Thanks for a great tool – this is the first time I’ve had a reason to report an issue, and I’ve been using the tool since pg version 7.3
Lou O’Quin
************************************************************************************************
Pg Version string PostgreSQL 9.2.3, compiled by Visual C++ build 1600, 32-bit (local to PC)
pgAdmin III Version 1.16.1 (Feb 5 2013, rev:REL-1_16_1)
O/S Windows 7 Enterprise Service Pack 1
*****************************************************************************
pgAdmin III - PostgreSQL Tools
pgAdmin III - PostgreSQL Tools has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
--
Thanks & Regards,
Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company

Attachment
Dinesh
Dinesh
Dinesh,Can you please take a look at it?On Thu, Mar 21, 2013 at 11:35 PM, Lou Oquin <LOquin@nammotalley.com> wrote:When I select Favourites, Add from the query window menu, and I enter a favourites name which contains spaces, I almost always get a fatal error message from Windows 7. The image (and text) of the error message is below.
When I restart pgAdmin, the favourite has been added (with spaces.)
If I then try to add another favourite (with spaces in the name,) the same thing happens.
The problem appears to persist until I use the Favourites Manage tool, edit the offending favourite name, and save it. Then, the issue goes away, but ONLY for the current session. If I close and restart pgAdmin, the issue is back again.
Thanks for a great tool – this is the first time I’ve had a reason to report an issue, and I’ve been using the tool since pg version 7.3
Lou O’Quin
************************************************************************************************
Pg Version string PostgreSQL 9.2.3, compiled by Visual C++ build 1600, 32-bit (local to PC)
pgAdmin III Version 1.16.1 (Feb 5 2013, rev:REL-1_16_1)
O/S Windows 7 Enterprise Service Pack 1
*****************************************************************************
pgAdmin III - PostgreSQL Tools
pgAdmin III - PostgreSQL Tools has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
--
--Thanks & Regards,
Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
Attachment
"pgadmin_favourites.xml". --> Usually, this located under "C:\Users\%CURRENT_USER%\Appdata\Roming\postgresql".
Thanks for your attention.
Ex:- "Weekly Report"
<?xml version="1.0" encoding="UTF-8"?>
<favourites>
<favourite title="Weekly Report">dfdfd </favourite>
</favourites>
7) Check the file "pgadmin_favourites.xml" for the value.
<?xml version="1.0" encoding="UTF-8"?>
<favourites>
<favourite title="Daily Report">fd fdfdf pgadmin_favourites.xml</favourite>
Best Regards,
Dinesh
Sure Ashesh,I will update this thread with my findings.Thanks.Best Regards,
Dinesh
On Mon, Mar 25, 2013 at 9:15 AM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote: > > While working on this issue in my local machine i have tried some test cases > to re-produce the same and found that "pgadmin_favourites.xml" overwriting > it's favorite details among the concurrent "Favourite" items. > > To re-produce the same case, i have followed the below steps. > > 1) Take 2 new pgAdmin instances in a same box. > > 2) From one instance take Favorite Dialog box from Query window. > > 3) From second instance take Favorite Dialog box from Query window. > > 4) Type your "Favorite" name in the text box of instance 1's Favorite Dialog > box and press "OK". > > Ex:- "Weekly Report" > 5) Check the file "pgadmin_favourites.xml" for the value. > > <?xml version="1.0" encoding="UTF-8"?> > <favourites> > <favourite title="Weekly Report">dfdfd </favourite> > </favourites> > > 6) Type your "Favorite" name in the text box of instance 2nd Favorite Dialog > box and press "OK". > > Ex:- "Daily Report" > > 7) Check the file "pgadmin_favourites.xml" for the value. > > <?xml version="1.0" encoding="UTF-8"?> > <favourites> > <favourite title="Daily Report">fd fdfdf pgadmin_favourites.xml</favourite> > </favourites> > 8) Once, we restart all the pgAdmin instances, i am not able to see my > "Weekly Report" Favorite from the list. > > Let me know if it is a Bug or a known behavior of pgAdmin. Thanks for your > guidance. I'm not entirely surprised it behaves that way, but it's not the nicest behaviour for sure. I think the most sensible fix would be to re-read the favourites file immediately before saving it, and then adding the new item. Want to try to come up with a patch when you get a few minutes spare? -- Dave Page Chief Architect, Tools & Installers EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company Blog: http://pgsnake.blogspot.com Twitter: @pgsnake
I'm not entirely surprised it behaves that way, but it's not theOn Mon, Mar 25, 2013 at 9:15 AM, Dinesh Kumar
<dinesh.kumar@enterprisedb.com> wrote:
>
> While working on this issue in my local machine i have tried some test cases
> to re-produce the same and found that "pgadmin_favourites.xml" overwriting
> it's favorite details among the concurrent "Favourite" items.
>
> To re-produce the same case, i have followed the below steps.
>
> 1) Take 2 new pgAdmin instances in a same box.
>
> 2) From one instance take Favorite Dialog box from Query window.
>
> 3) From second instance take Favorite Dialog box from Query window.
>
> 4) Type your "Favorite" name in the text box of instance 1's Favorite Dialog
> box and press "OK".
>
> Ex:- "Weekly Report"
> 5) Check the file "pgadmin_favourites.xml" for the value.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <favourites>
> <favourite title="Weekly Report">dfdfd </favourite>
> </favourites>
>
> 6) Type your "Favorite" name in the text box of instance 2nd Favorite Dialog
> box and press "OK".
>
> Ex:- "Daily Report"
>
> 7) Check the file "pgadmin_favourites.xml" for the value.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <favourites>
> <favourite title="Daily Report">fd fdfdf pgadmin_favourites.xml</favourite>
> </favourites>
> 8) Once, we restart all the pgAdmin instances, i am not able to see my
> "Weekly Report" Favorite from the list.
>
> Let me know if it is a Bug or a known behavior of pgAdmin. Thanks for your
> guidance.
nicest behaviour for sure. I think the most sensible fix would be to
re-read the favourites file immediately before saving it, and then
adding the new item. Want to try to come up with a patch when you get
a few minutes spare?
--
Dave Page
Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
Thanks for your attention.
Dinesh
I'm not entirely surprised it behaves that way, but it's not theOn Mon, Mar 25, 2013 at 9:15 AM, Dinesh Kumar
<dinesh.kumar@enterprisedb.com> wrote:
>
> While working on this issue in my local machine i have tried some test cases
> to re-produce the same and found that "pgadmin_favourites.xml" overwriting
> it's favorite details among the concurrent "Favourite" items.
>
> To re-produce the same case, i have followed the below steps.
>
> 1) Take 2 new pgAdmin instances in a same box.
>
> 2) From one instance take Favorite Dialog box from Query window.
>
> 3) From second instance take Favorite Dialog box from Query window.
>
> 4) Type your "Favorite" name in the text box of instance 1's Favorite Dialog
> box and press "OK".
>
> Ex:- "Weekly Report"
> 5) Check the file "pgadmin_favourites.xml" for the value.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <favourites>
> <favourite title="Weekly Report">dfdfd </favourite>
> </favourites>
>
> 6) Type your "Favorite" name in the text box of instance 2nd Favorite Dialog
> box and press "OK".
>
> Ex:- "Daily Report"
>
> 7) Check the file "pgadmin_favourites.xml" for the value.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <favourites>
> <favourite title="Daily Report">fd fdfdf pgadmin_favourites.xml</favourite>
> </favourites>
> 8) Once, we restart all the pgAdmin instances, i am not able to see my
> "Weekly Report" Favorite from the list.
>
> Let me know if it is a Bug or a known behavior of pgAdmin. Thanks for your
> guidance.
nicest behaviour for sure. I think the most sensible fix would be to
re-read the favourites file immediately before saving it, and then
adding the new item. Want to try to come up with a patch when you get
a few minutes spare?Sure Dave.Best Regards,Dinesh--
Dave Page
Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
Attachment
Dinesh
Hi On Wed, Mar 27, 2013 at 7:03 AM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote: > Hi Dave, > > Thanks for the guidance on this. I am attaching the patch for the same. Unfortunately I think there are a few issues here. 1) Please keep an eye on your formatting: - There are spelling mistakes in comments. - There should generally be a blankline before a comment, as they typically introduce or describe a logical code block (see http://wiki.postgresql.org/wiki/PgAdmin_Internals#Coding_Style, in particular point 4) 2) You recreate the favourites array, but don't free the original array, thus creating a memory leak. 3) The new favourites array is not synced with the UI, so although other users changes to the files aren't overwritten, they're not shown either. This could lead to duplicate favourites being created. 4) We probably need the same changes for Macros. I'm not sure that fixing 3 is likely to be particularly straightforward, and given the low impact of this issue, I'm inclined to think your time would be better spent on other work at the moment. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Dinesh
HiUnfortunately I think there are a few issues here.
On Wed, Mar 27, 2013 at 7:03 AM, Dinesh Kumar
<dinesh.kumar@enterprisedb.com> wrote:
> Hi Dave,
>
> Thanks for the guidance on this. I am attaching the patch for the same.
1) Please keep an eye on your formatting:
- There are spelling mistakes in comments.
- There should generally be a blank line before a comment, as they
typically introduce or describe a logical code block (see
http://wiki.postgresql.org/wiki/PgAdmin_Internals#Coding_Style, in
particular point 4)
2) You recreate the favourites array, but don't free the original
array, thus creating a memory leak.
3) The new favourites array is not synced with the UI, so although
other users changes to the files aren't overwritten, they're not shown
either. This could lead to duplicate favourites being created.
4) We probably need the same changes for Macros.
I'm not sure that fixing 3 is likely to be particularly
straightforward, and given the low impact of this issue, I'm inclined
to think your time would be better spent on other work at the moment.
--
Dave PageBlog: http://pgsnake.blogspot.comEnterpriseDB UK: http://www.enterprisedb.com
Twitter: @pgsnake
The Enterprise PostgreSQL Company
--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support