Why?
I want a database because scanning the switches every time I want to test some logic takes upwards of a minute and a half.
Online Documentation
http://www.postgresql.org/docs/7.4/interactive/index.html
Postgres
# su - postgres
$ createdb switchdb
$ psql -s switchdb
# create user switchdb password 'switchdb';
# grant all privileges on switchdb to switchdb;
- That last line didn't work; (
Ref) it should be
# grant all on database switchdb to switchdb;
- Enabled TCP/IP in ~postgres/data/postgresql.conf:
tcpip_socket = true
port = 5432
- Also you must edit the data/pg_hba file to permit tcp/ip connections through the loopback and restart the databse.
Selecting a database
$ psql
postgres=# c netflow
You are now connected to database "netflow" as user "postgres".
netflow=#
List tables in active database
netflow=# dt
List of relations
Schema | Name | Type | Owner
--------+-----------------+-------+---------
public | rdc_created | table | netflow
public | rdc_flows | table | netflow
public | rdc_loaded | table | netflow
public | rdc_localip | table | netflow
public | rdc_statsloaded | table | netflow
(5 rows)netflow=#