Windows OS postgresql command:
1. go to postgresql's executable commands directory
> cd c:\Program Files\PostgreSQL\9.0\bin
2. Backup a postgresql database
> pg_dump.exe -U <username> -h <ip_address> -p <port> -W <db_name> > <backup_file>
3. Resume a backup db to database system
> psql.exe -U <username> -h <ip_address> -p <port> -d <db_name> < <backup_file>
4. To execute a postgresql script
> psql.exe -U <username> -h <ip_address> -p <port> -d <db_name> -c "<command>"
> psql.exe -U <username> -h <ip_address> -p <port> -d <db_name> -c "<command>"
5. To drop a database
> psql.exe -U <username> -h <ip_address> -p <port> -d <db_name> -c "DROP DATABASE <db_name>"
> psql.exe -U <username> -h <ip_address> -p <port> -d <db_name> -c "DROP DATABASE <db_name>"
6.To create a database
> psql.exe -U <username> -h <ip_address> -p <port> -d <db_name> -c "CREATE DATABASE <db_name>"
6.To create a database that support for UTF-8
> createdb.exe -E UTF8 -T template0 --lc-collate=american_usa --lc-ctype=american_usa -h <ip_address> -p <port> -U <username> -W <db_name>