psql is the main tool for interacting with Postgres.
- You can use it to enter commands manually, on the command line.
- Usually, it is better to put commands in a script and execute the script.
jao@mintyzack ~ $ psql jao
Pager usage is off.
Type "help" for help.
jao=# create table t(x int);
jao=# insert into t values(1), (2), (3);
INSERT 0 3
jao=# select * from t;
- psql jao: Runs psql on the
database jao, (which must have been created already).
- create table ...: Creates a table, (duh!)
- select * from t: select all columns (denoted by *) from table t.