#!/usr/bin/env perl #-- createdb creates a PostgreSQL database. # #-- Usage: # createdb [options] dbname [description] # #-- Options: # -D, --location=PATH Alternative place to store the database # -T, --template=TEMPLATE Template database to copy # -E, --encoding=ENCODING Multibyte encoding for the database # -h, --host=HOSTNAME Database server host # -p, --port=PORT Database server port # -U, --username=USERNAME Username to connect as # -W, --password Prompt for password # -e, --echo Show the query being sent to the backend # -q, --quiet Don't write any messages # #-- By default, a database with the same name as the current user is created. #--- Created S.Lebedeva #--- Last modofied 12.3.02 $qv="@"; print "Please, enter your username:"; $buf=; chomp($buf); $user=$buf; print "Please, enter database name you wish to create: "; $buf=; chomp($buf); $dbname=$buf; $cmd="$ENV{UPS_PROD_DIR}/bin/createdb -U $user -W -p $ENV{PGPORT} -h $ENV{PGDATA} $dbname"; system( $cmd );