I wanted to answer this for you but I didn't see a reply button on the site.
In pgadmin,
it's File ==> Options ==> Query tool ==> History file ==> default is 1024. try 4096 if you have more then 8G on your PC.