Tools

Rename or drop a default empty PostgreSQL embedded database on Web Help Desk

This article provides the steps to rename or drop a default empty PostgreSQL embedded database via a command line

First published date

10/18/2018 9:44 AM

Last published date

9/13/2019 9:41 PM

Overview

You may be able to rename or drop a default empty PostgreSQL embedded database using the command line. This can be done via a command line on Windows command prompt  or Linux shell command.

Product section

Web Help Desk

Resolution

Rename/Drop default empty PostgreSQL embedded database

Windows

  1. Open cmd > enter: cd C:\Progra~1\WebHelpDesk
  2. Enter: pgsql9\bin\psql -h 127.0.0.1 -p 20293 -U whd -d template1
  3. If prompted for the database password, enter your database password and execute the following statements:
  4. ALTER DATABASE whd rename to whd_old;
  5. CREATE DATABASE (enter the password for the database without brackets);
  6. Exit psql tool: \q and press Enter.

Virtual Appliance (Linux)

  1. Open cmd > enter: cd /usr/local/webhelpdesk/
  2. Enter: sudo pgsql9/bin/psql -h 127.0.0.1 -p 20293 -U whd -d template1
  3. If prompted for the database password, enter your database password and execute the following statements:
  4. ALTER DATABASE whd rename to whd_old;
  5. CREATE DATABASE whd (enter the password for the database without brackets);
  6. Exit psql tool: \q and press Enter.