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

postgresql

Created by dave. Last edited by dave, 196 days ago. Viewed 2,183 times. #6
[diff] [history] [edit] [rdf]
labels
attachments

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=#

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:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt