For When You Can't Have The Real Thing
[ start | index | login ]
start > dave > experiments > Switch Topology > postgresql


Created by dave. Last edited by dave, 134 days ago. Viewed 2,107 times. #6
[diff] [history] [edit] [rdf]


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



# 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".

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)


no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt