Sorry, my fault that I run the script in the query window of pgAdmin, not in the system console. I check it again in the system console and it works well.
Thanks,Sabin