# Database
# General information
Hand2Note uses PostgreSQL to store hands and statistical data. However, Hand2Note doesn't require PostgreSQL installed on your PC. Hand2Note by default uses its own bundled database server, so you don't need to worry about PostgreSQL at all.
By default, Hand2Note database is stored in C:/Users/YourUsername/AppData/Roaming/Hand2Note/h2ndb folder.
AppData is a hidden folder, to open it do the following:
- Open File Explorer
- Type %appdata% into the address bar and hit enter
Notes and color markers are stored in Hand2Note installation directory, not in the database.
# Database management
# Creating a new database
- Go to Configuration → Database
- Click "Create database…"
- Enter the name of a new database
- Click "Activate"
- Wait while Hand2Note restarts.
- Go back to Configuration → Database and delete the old database, if necessary.
You can import previously played hands into a new database either by pre-exporting them from the old database or from C:/Hand2NoteHH folder.
# Moving database to another drive, directory or PC
Take a look at the Moving database guide in Export and Moving section.
# Additionally
# How to delete hands from database
You can’t selectively delete hands from the database. This feature is not implemented, since the violation of data integrity significantly reduces the performance of the database.
You can create a new database and import only the necessary hands into it.
# How to use your own PostgreSQL server
# How to connect to database using PgAdmin
- Start Hand2Note
- Go to Configuration → Database
- Disable "Connect to custom server" option and then activate an existing database
- Start the file Hand2Note/pgsql/bin/pgadmin3.exe
- Press "Add new connection to server"
- Enter Name=h2nserver, Host=localhost, Port=5318 and press OK
- Done! Server h2nserver should appear in the list of available servers