1. In a terminal:
$ psql
2. Get into a postgresql with role "postgres", then create a user "db"
postgres-# create role dbcreator with password 'nifti';
3. Change user to postgres
$ sudo su postgres
postgres@computername:/home/$ sudo su postgres
4. Create db mydb and get into mydb
postgres@computername:/home/$ psql
postgres=# create database mydb with owner=dbcreator;
How to get help :
postgres=# \h create database
5. 返回username用户下,进入mydb
username@computername:/home/db$ psql -d mydb
mydb=#
6. search commands:
mdb=# \?
7. Check table in mydb
mdb=# \d
8. Then we know \i can run a file
mydb=\i createdummy.sql
9. At last, we create a table for storage a ROS bag data, and we retrieval data by its id, topic, type, sizeoftopic or target.
*/db $ python extract* *.bag
10. Make the database can be accessed by remote users