Cisco IM&P Chat Room Postgres Server

If you want to implement chat rooms/persistent chat or chat logging with Cisco IM and Presence, you need to setup an external postgres server.  The setup is relatively easy (I used a ubuntu server), and can be found HERE 

The problem I came across was that while testing, I created several chat rooms, then deleted the users who owned those chat rooms.  I needed a way to delete those test chat rooms, which needs to be done on the postgres server (since the users no longer existed).  Here are the steps I used:

  1. SSH to postgres server and become the postgres user: su – postgres
  2. As the postgres user, login to the database: psql -d tcmadb
  3. To view the chat rooms stored in the database, run: SELECT room_jid FROM tc_rooms;
  4. I wanted to delete ALL chat rooms previously created, so I truncated the table: TRUNCATE tc_rooms;
  5. All done!  All chat rooms are now deleted.  If you want to delete a specific room, you’ll need to select and delete a specific row instead of truncate

Additional useful postgres database commands:

Show all tables: \dt
To quit: \q
Show all rows in a table: \d+ tablename


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s