mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
New scripts for create/drop user/db from Peter Eisentraut
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.10 1999/08/08 04:18:29 thomas Exp $
|
||||
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.11 1999/12/04 04:53:14 momjian Exp $
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@ -67,10 +67,11 @@ vpath %.sgml ./ref
|
||||
|
||||
MANSOURCES= $(wildcard ref/*.sgml)
|
||||
|
||||
APPLICATIONS= createdb.sgml createuser.sgml \
|
||||
createlang.sgml \
|
||||
destroydb.sgml destroyuser.sgml \
|
||||
destroylang.sgml \
|
||||
APPLICATIONS= \
|
||||
createdb.sgml
|
||||
createuser.sgml \
|
||||
dropdb.sgml
|
||||
dropuser.sgml \
|
||||
initdb.sgml initlocation.sgml \
|
||||
ipcclean.sgml \
|
||||
pg_dump.sgml \
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/docguide.sgml,v 1.22 1999/10/09 02:29:15 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/docguide.sgml,v 1.23 1999/12/04 04:53:14 momjian Exp $
|
||||
Documentation Guide
|
||||
Thomas Lockhart
|
||||
|
||||
@ -503,8 +503,8 @@ Status
|
||||
<row><entry> ./doc/src/sgml/ref/createuser.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/declare.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/delete.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/destroydb.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/destroyuser.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/dropdb.sgml </entry><entry> Renamed for v7.0 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/dropuser.sgml </entry><entry> Renamed for v7.0 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/drop_aggregate.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/drop_database.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
<row><entry> ./doc/src/sgml/ref/drop_function.sgml </entry><entry> New for v6.4 </entry></row>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.12 1999/10/01 15:24:09 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.13 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
Complete list of usable sgml source files in this directory.
|
||||
-->
|
||||
@ -100,11 +100,9 @@ Complete list of usable sgml source files in this directory.
|
||||
|
||||
<!-- these are in the "utilities" reference chapter -->
|
||||
<!entity createdb system "createdb.sgml">
|
||||
<!entity createlang system "createlang.sgml">
|
||||
<!entity createuser system "createuser.sgml">
|
||||
<!entity destroydb system "destroydb.sgml">
|
||||
<!entity destroylang system "destroylang.sgml">
|
||||
<!entity destroyuser system "destroyuser.sgml">
|
||||
<!entity dropdb system "dropdb.sgml">
|
||||
<!entity dropuser system "dropuser.sgml">
|
||||
<!entity ecpgRef system "ecpg-ref.sgml">
|
||||
<!entity initdb system "initdb.sgml">
|
||||
<!entity initlocation system "initlocation.sgml">
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/commands.sgml,v 1.19 1999/10/01 15:24:09 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/commands.sgml,v 1.20 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -107,11 +107,9 @@ functions supported by <productname>Postgres</productname>.
|
||||
</abstract>
|
||||
|
||||
&createdb;
|
||||
&createlang;
|
||||
&createuser;
|
||||
&destroydb;
|
||||
&destroylang;
|
||||
&destroyuser;
|
||||
&dropdb;
|
||||
&dropuser;
|
||||
&ecpgRef;
|
||||
&pgAccess;
|
||||
&pgAdmin;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.9 1999/07/22 15:09:07 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.10 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -68,7 +68,7 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> [ WITH LOCATIO
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATEDB
|
||||
CREATE DATABASE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -184,16 +184,15 @@ comment from Olly; response from Thomas...
|
||||
<computeroutput>Creating Postgres database system directory /home/olly/private_db/base</computeroutput>
|
||||
|
||||
<prompt>$</prompt> <userinput>psql olly</userinput>
|
||||
<computeroutput>Welcome to the POSTGRESQL interactive sql monitor:
|
||||
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
|
||||
|
||||
type \? for help on slash commands
|
||||
type \q to quit
|
||||
type \g or terminate with semicolon to execute query
|
||||
You are currently connected to the database: template1
|
||||
|
||||
<computeroutput>Welcome to psql, the PostgreSQL interactive terminal.
|
||||
(Please type \copyright to see the distribution terms of PostgreSQL.)
|
||||
|
||||
Type \h for help with SQL commands,
|
||||
\? for help on internal slash commands,
|
||||
\q to quit,
|
||||
\g or terminate with semicolon to execute query.
|
||||
<prompt>olly=></prompt></computeroutput> <userinput>create database elsewhere with location = '/home/olly/private_db';</userinput>
|
||||
<computeroutput>CREATEDB</computeroutput>
|
||||
<computeroutput>CREATE DATABASE</computeroutput>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -1,11 +1,11 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.10 1999/11/30 03:57:23 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.11 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
<refentry id="SQL-CREATEUSER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<refentrytitle id="sql-createuser-title">
|
||||
CREATE USER
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.6 1999/08/06 13:50:30 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.7 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -15,22 +15,20 @@ Postgres documentation
|
||||
<application>createdb</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Create a new <productname>Postgres</productname> database
|
||||
Create a new <productname>PostgreSQL</productname> database
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-07-20</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
createdb [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
createdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -D <replaceable class="parameter">datadir</replaceable> ] [ -u ] [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">description</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-CREATEDB-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
@ -39,43 +37,66 @@ createdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replacea
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<term>-h, --host <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running. Defaults to using a local Unix domain socket
|
||||
rather than an IP connection.
|
||||
is running.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<term>-p, --port <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections. The port number defaults to 5432,
|
||||
or the value of the <envar>PGPORT</envar>
|
||||
environment variable (if set).
|
||||
is listening for connections.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-u</term>
|
||||
<term>-U, --username <replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication.
|
||||
Prompts for
|
||||
<replaceable class="parameter">username</replaceable>
|
||||
and <replaceable class="parameter">password</replaceable>.
|
||||
Username to connect as.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-D <replaceable class="parameter">datadir</replaceable></term>
|
||||
<term>-W, --password</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Force password prompt.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-e, --echo</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Echo the queries that <application>createdb</application> generates
|
||||
and sends to the backend.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-q, --quiet</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Do not display a response.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-D, --dbpath <replaceable class="parameter">datadir</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the alternate database location for this database installation.
|
||||
@ -85,177 +106,141 @@ createdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replacea
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-E, --encoding <replaceable class="parameter">encoding</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the character encoding scheme to be used with this database.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the database to be created. The name must be
|
||||
unique among all <productname>Postgres</productname> databases in this installation.
|
||||
<replaceable class="parameter">dbname</replaceable>
|
||||
defaults to the value of the
|
||||
<envar>USER</envar>
|
||||
environment variable.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">description</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This optionally specifies a comment to be associated with the newly created
|
||||
database.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
The options <literal>-h</literal>, <literal>-p</literal>, <literal>-U</literal>,
|
||||
<literal>-W</literal>, and <literal>-e</literal> are passed on literally to
|
||||
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-APP-CREATEDB-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
<application>createdb</application> will create files in the
|
||||
<filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
|
||||
data area for the new database.
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<term><computeroutput>CREATE DATABASE</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>createdb</application> could not attach to the
|
||||
<application>postmaster</application>
|
||||
process on the specified host and port. If you see this message,
|
||||
ensure that the <application>postmaster</application>
|
||||
is running on the proper host and that you have specified the proper
|
||||
port. If your site uses an authentication system, ensure that you
|
||||
have obtained the required authentication credentials.
|
||||
</para>
|
||||
<para>The database was successfully created.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<term><computeroutput>createdb: Database creation failed.</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||
and and will not be allowed to access <productname>Postgres</productname>.
|
||||
Contact your <productname>Postgres</productname> administrator.
|
||||
</para>
|
||||
<para>(Says it all.)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<term><computeroutput>createdb: Comment creation failed.</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have permission to create new databases.
|
||||
Contact your <productname>Postgres</productname> site administrator.
|
||||
The comment/description for the database could not be created.
|
||||
the database itself will have been created already. You can use the
|
||||
<acronym>SQL</acronym> command <command>COMMENT ON DATABASE</command> to
|
||||
create the comment later on.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: createdb: database '<replaceable class="parameter">dbname</replaceable>' already exists.
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The database already exists.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
or in the backend server. Ensure that your site administrator has
|
||||
properly installed <productname>Postgres</productname>and initialized the site with
|
||||
<application>initdb</application>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
If there is an error condition, the backend error message will be displayed.
|
||||
See <xref linkend="SQL-CREATEDATABASE" endterm="SQL-CREATEDATABASE-title">
|
||||
and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<application>createdb</application> internally runs
|
||||
<command>CREATE DATABASE</command> from <application>psql</application>
|
||||
while connected to the <literal>template1</literal> database.
|
||||
</para>
|
||||
</note>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 id="R1-APP-CREATEDB-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<application>createdb</application> creates a new
|
||||
<productname>Postgres</productname> database.
|
||||
The person who executes this command becomes
|
||||
the database administrator, or <acronym>DBA</acronym>,
|
||||
for this database and is the only
|
||||
person, other than the <productname>Postgres</productname> super-user,
|
||||
who can destroy it.
|
||||
<application>createdb</application> creates a new <productname>PostgreSQL</productname>
|
||||
database. The user who executes this command becomes the database owner.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<application>createdb</application> is a shell script that invokes
|
||||
<application>psql</application>.
|
||||
Hence, a <application>postmaster</application>
|
||||
process must be running on the database server host before
|
||||
<application>createdb</application>
|
||||
is executed. The
|
||||
<envar>PGOPTION</envar>
|
||||
and
|
||||
<envar>PGREALM</envar>
|
||||
environment variables will be passed on to
|
||||
<application>psql</application>
|
||||
and processed as described in
|
||||
<xref linkend="app-psql-title" endterm="app-psql-title">.
|
||||
<application>createdb</application> is a shell script wrapper around the
|
||||
<acronym>SQL</acronym> command
|
||||
<xref linkend="SQL-CREATEDATABASE" endterm="SQL-CREATEDATABASE-title"> via
|
||||
the <productname>PostgreSQL</productname> interactive terminal
|
||||
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
|
||||
special about creating databases via this or other methods. This means
|
||||
that the <application>psql</application> must be found by the script and that
|
||||
a database server is running at the targeted host. Also, any default
|
||||
settings and environment variables available to <application>psql</application>
|
||||
and the <application>libpq</application> front-end library do apply.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-CREATEDB-2">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To create the database <literal>demo</literal>
|
||||
using the postmaster on the local host, port 5432:
|
||||
using the default database server:
|
||||
|
||||
<programlisting>
|
||||
$ createdb demo
|
||||
$ <userinput>createdb demo</userinput>
|
||||
CREATE DATABASE
|
||||
</programlisting>
|
||||
|
||||
The response is the same as you would have gotten from running the
|
||||
<command>CREATE DATABASE</command> <acronym>SQL</acronym> command.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To create the database <literal>demo</literal>
|
||||
using the postmaster on host eden, port 5000:
|
||||
using the postmaster on host eden, port 5000, using the <literal>LATIN1</literal>
|
||||
encoding scheme and look at the underlying query:
|
||||
|
||||
<programlisting>
|
||||
$ createdb -p 5000 -h eden demo
|
||||
$ <userinput>createdb -p 5000 -h eden -E LATIN1 -e demo</userinput>
|
||||
QUERY: CREATE DATABASE "demo" WITH ENCODING = 'LATIN1'
|
||||
CREATE DATABASE
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -1,172 +0,0 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.1 1999/08/06 13:50:30 thomas Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
<refentry id="APP-CREATELANG">
|
||||
<refmeta>
|
||||
<refentrytitle id="APP-CREATELANG-TITLE">
|
||||
<application>createlang</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname id="createlang">
|
||||
<application>createlang</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Add a new programming language to a <productname>Postgres</productname> database
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-08-05</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
createlang [ <replaceable class="parameter">langname</replaceable> ]
|
||||
createlang [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ <replaceable class="parameter">langname</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-CREATELANG-1">
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
<application>createlang</application> accepts the following command line arguments:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">langname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the backend programming language to be defined.
|
||||
<application>createlang</application> will prompt for
|
||||
<replaceable class="parameter">langname</replaceable>
|
||||
if it is not specified on the command line.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<application>createlang</application> also accepts
|
||||
the following command line arguments for connection parameters:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running. Defaults to using a local Unix domain socket
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections. The port number defaults to 5432,
|
||||
or the value of the <envar>PGPORT</envar>
|
||||
environment variable (if set).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<!--
|
||||
<varlistentry>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication.
|
||||
Prompts for
|
||||
<replaceable class="parameter">username</replaceable>
|
||||
and <replaceable class="parameter">password</replaceable>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
-->
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-APP-CREATELANG-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
<application>createlang</application> installs a new programming
|
||||
language into a <productname>Postgres</productname> server,
|
||||
so has not explicit external output.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 id="R1-APP-CREATELANG-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
|
||||
<para>
|
||||
<application>createlang</application> is a utility for adding a new
|
||||
programming language to a
|
||||
<productname>Postgres</productname> database.
|
||||
<application>createlang</application> currently accepts two
|
||||
languages, <literal>plsql</literal> and <literal>pltcl</literal>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-CREATELANG-2">
|
||||
<title>
|
||||
Notes
|
||||
</title>
|
||||
|
||||
<para>
|
||||
See
|
||||
<xref linkend="sql-createlanguage" endterm="sql-createlanguage-title">
|
||||
for more details.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-CREATELANG-3">
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To install <literal>pltcl</literal>:
|
||||
|
||||
<programlisting>
|
||||
% createlang pltcl
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../reference.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.5 1999/07/22 15:09:09 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.6 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -15,23 +15,21 @@ Postgres documentation
|
||||
<application>createuser</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Create a new <productname>Postgres</productname> user
|
||||
Create a new <productname>PostgreSQL</productname> user
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-07-20</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsynopsisdivinfo>
|
||||
|
||||
<synopsis>
|
||||
createuser [ <replaceable class="parameter">username</replaceable> ]
|
||||
createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -i <replaceable class="parameter">userid</replaceable> ] [ -d | -D ] [ -u | -U ]
|
||||
[ <replaceable class="parameter">username</replaceable> ]
|
||||
createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable class="parameter">username</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-CREATEUSER-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
@ -40,76 +38,89 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<term>-h, --host <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running. Defaults to using a local Unix domain socket
|
||||
rather than an IP connection.
|
||||
is running.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<term>-p, --port <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections. The port number defaults to 5432,
|
||||
or the value of the <envar>PGPORT</envar>
|
||||
environment variable (if set).
|
||||
is listening for connections.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-d</term>
|
||||
<term>-e, --echo</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows the user to create databases.
|
||||
Echo the queries that <application>createdb</application> generates
|
||||
and sends to the backend.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-D</term>
|
||||
<term>-q, --quiet</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Forbids the user to create databases.
|
||||
Do not display a response.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-i <replaceable class="parameter">userid</replaceable></term>
|
||||
<term>-d, --createdb</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the numeric identifier to be associated with this user.
|
||||
This identifier must be unique among all
|
||||
<productname>Postgres</productname> users, and is not required
|
||||
to match the operating system UID.
|
||||
You will be prompted for an identifier if none is specified on the command line,
|
||||
and it will suggest an identifier matching the UID.
|
||||
Allows the new user to create databases.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-u</term>
|
||||
<term>-D, --no-createdb</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows the user to create other users.
|
||||
Forbids the new user to create databases.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-U</term>
|
||||
<term>-a, --adduser</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Forbids the user to create other users.
|
||||
Allows the new user to create other users.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-A, --no-adduser</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Forbids the new user to create other users.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-P, --pwprompt</term>
|
||||
<listitem>
|
||||
<para>
|
||||
If given, <application>createuser</application> will issue a prompt for
|
||||
the password of the new user. This is not necessary if you do not plan
|
||||
on using password authentication.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -118,166 +129,126 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
||||
<term><replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the <productname>Postgres</productname> user to be created.
|
||||
This name must be unique among all <productname>Postgres</productname> users.
|
||||
You will be prompted for a name if none is specified on the command line.
|
||||
Specifies the name of the <productname>PostgreSQL</productname> user to be created.
|
||||
This name must be unique among all <productname>PostgreSQL</productname> users.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
You will be prompted for a name and other missing information if it is not
|
||||
specified on the command line.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The options <literal>-h</literal>, <literal>-p</literal>, and <literal>-e</literal>,
|
||||
are passed on literally to <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. If you
|
||||
need the <application>psql</application> options <literal>-U</literal> and
|
||||
<literal>-W</literal> as well, you can uncomment the
|
||||
respective lines in the source. They are disabled by default because of the potential
|
||||
conceptual confusion between existing and new users.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-APP-CREATEUSER-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
<date>1999-11-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
<application>createuser</application> will add an entry in the
|
||||
<literal>pg_user</literal> or <literal>pg_shadow</literal> system table.
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||
createuser: database access failed.
|
||||
</computeroutput></term>
|
||||
<term><computeroutput>CREATE USER</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>createuser</application> could not attach to the
|
||||
<application>postmaster</application>
|
||||
process on the specified host and port. If you see this message,
|
||||
ensure that the <application>postmaster</application>
|
||||
is running on the proper host and that you have specified the proper
|
||||
port. If your site uses an authentication system, ensure that you
|
||||
have obtained the required authentication credentials.
|
||||
All is well.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
createuser: database access failed.
|
||||
</computeroutput></term>
|
||||
<term><computeroutput>createuser: Creation of user "<replaceable class="parameter">username</replaceable>" failed.</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||
and and will not be allowed to access <productname>Postgres</productname>. Contact your
|
||||
<productname>Postgres</productname> administrator.
|
||||
Something went wrong. The user was not created.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
createuser: <replaceable class="parameter">username</replaceable> cannot create users.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have permission to create new users; contact your
|
||||
<productname>Postgres</productname> site administrator.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
createuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The user to be added already has an entry in the
|
||||
<literal>pg_shadow</literal> class.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
database access failed
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
or in the backend server. Ensure that your site administrator has
|
||||
properly installed <productname>Postgres</productname>and initialized the site with
|
||||
<application>initdb</application>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<application>createuser</application> internally runs
|
||||
<command>CREATE USER</command> from <application>psql</application>
|
||||
while connected to the <literal>template1</literal> database.
|
||||
</para>
|
||||
</note>
|
||||
If there is an error condition, the backend error message will be displayed.
|
||||
See <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
|
||||
and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 id="R1-APP-CREATEUSER-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
<date>1998-11-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<application>createuser</application> creates a
|
||||
new <productname>Postgres</productname> user.
|
||||
new <productname>PostgreSQL</productname> user.
|
||||
Only users with <literal>usesuper</literal> set in
|
||||
the <literal>pg_shadow</literal> class can create
|
||||
new <productname>Postgres</productname> users. As shipped,
|
||||
the user <literal>postgres</literal> can create users.
|
||||
</para>
|
||||
<para>
|
||||
<application>createuser</application> is a shell script that invokes
|
||||
<application>psql</application>.
|
||||
Hence, a <application>postmaster</application>
|
||||
process must be running on the database server host before
|
||||
<application>createuser</application> is executed.
|
||||
The
|
||||
<envar>PGOPTION</envar>
|
||||
and
|
||||
<envar>PGREALM</envar>
|
||||
environment variables will be passed on to
|
||||
<application>psql</application>
|
||||
and processed as described in
|
||||
<xref endterm="app-psql-title" linkend="app-psql-title">.
|
||||
new <productname>Postgres</productname> users.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once invoked, <application>createuser</application>
|
||||
will ask a series of questions to obtain parameters not specified on
|
||||
the command line. The new user's database login name and a numeric
|
||||
user identifier must be specified.
|
||||
|
||||
<note>
|
||||
<para>
|
||||
The <productname>Postgres</productname> user identifier
|
||||
does not need to be the same as the user's Unix UID. However, typically
|
||||
they are assigned to be the same.
|
||||
</para>
|
||||
</note>
|
||||
<application>createuser</application> is a shell script wrapper around the
|
||||
<acronym>SQL</acronym> command
|
||||
<xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title"> via
|
||||
the <productname>PostgreSQL</productname> interactive terminal
|
||||
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
|
||||
special about creating users via this or other methods. This means
|
||||
that the <application>psql</application> must be found by the script and that
|
||||
a database server is running at the targeted host. Also, any default
|
||||
settings and environment variables available to <application>psql</application>
|
||||
and the <application>libpq</application> front-end library do apply.
|
||||
</para>
|
||||
|
||||
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 id="R1-APP-CREATEUSER-2">
|
||||
<refsect1info>
|
||||
<date>1999-11-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
You must also describe the privileges of the new user for security purposes.
|
||||
Specifically, you will be asked whether the new user should be able to
|
||||
act as <productname>Postgres</productname> super-user,
|
||||
whether the new user may create new databases and whether the new user
|
||||
is allowed to create other new users.
|
||||
To create a user <literal>joe</literal>
|
||||
on the default database server:
|
||||
|
||||
<programlisting>
|
||||
$ <userinput>createuser joe</userinput>
|
||||
Is the new user allowed to create databases? (y/n) <userinput>n</userinput>
|
||||
Shall the new user be allowed to create more new users? (y/n) <userinput>n</userinput>
|
||||
CREATE USER
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To create the same user <literal>joe</literal>
|
||||
using the postmaster on host eden, port 5000, avoiding
|
||||
the prompts and taking a look at the underlying query:
|
||||
|
||||
<programlisting>
|
||||
$ <userinput>createuser -p 5000 -h eden -D -A -e joe</userinput>
|
||||
QUERY: CREATE USER "joe" NOCREATEDB NOCREATEUSER
|
||||
CREATE USER
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@ -1,281 +0,0 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/destroydb.sgml,v 1.5 1999/07/22 15:09:10 thomas Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
<refentry id="APP-DESTROYDB">
|
||||
<refmeta>
|
||||
<refentrytitle id="APP-DESTROYDB-TITLE">
|
||||
<application>destroydb</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>destroydb</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Remove an existing <productname>Postgres</productname> database
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-07-20</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
destroydb [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -i ] [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-DESTROYDB-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running. Defaults to using a local Unix domain socket
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections. The port number defaults to 5432,
|
||||
or the value of the <envar>PGPORT</envar>
|
||||
environment variable (if set).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-i</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Run in interactive mode.
|
||||
Prompts for confirmation before destroying a database.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the database to be destroyed. The database
|
||||
must be one of the existing <productname>Postgres</productname> databases
|
||||
in this installation.
|
||||
<replaceable class="parameter">dbname</replaceable>
|
||||
defaults to the value of the
|
||||
<envar>USER</envar>
|
||||
environment variable.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-APP-DESTROYDB-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
<application>destroydb</application> will remove files from the
|
||||
<filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
|
||||
data area for the existing database.
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
connectDB() failed: Is the postmaster running and accepting connections
|
||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>destroydb</application> could not attach to the
|
||||
<application>postmaster</application>
|
||||
process on the specified host and port. If you see this message,
|
||||
ensure that the <application>postmaster</application>
|
||||
is running on the proper host and that you have specified the proper
|
||||
port. If your site uses an authentication system, ensure that you
|
||||
have obtained the required authentication credentials.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||
and and will not be allowed to access <productname>Postgres</productname>.
|
||||
Contact your <productname>Postgres</productname> administrator.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have permission to destroy (or create) databases.
|
||||
Contact your <productname>Postgres</productname> site administrator.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: destroydb: database '<replaceable class="parameter">dbname</replaceable>' does not exist.
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The database to be removed does not have an entry in the
|
||||
<literal>pg_database</literal> class.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: destroydb: database '<replaceable class="parameter">dbname</replaceable>' is not owned by you.
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You are not the Database Administrator (DBA) for the specified database.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
or in the backend server. Ensure that your site administrator has
|
||||
properly installed <productname>Postgres</productname>and initialized the site with
|
||||
<application>initdb</application>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<application>destroydb</application> internally runs
|
||||
<command>DESTROY DATABASE</command> from <application>psql</application>
|
||||
while connected to the <literal>template1</literal> database.
|
||||
</para>
|
||||
</note>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 id="R1-APP-DESTROYDB-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<application>destroydb</application> destroys an existing
|
||||
<productname>Postgres</productname> database.
|
||||
The person who executes this command must be
|
||||
the database administrator, or <acronym>DBA</acronym>,
|
||||
or must be the <productname>Postgres</productname> super-user.
|
||||
The program runs silently; no confirmation message will be displayed.
|
||||
After the database is destroyed, a Unix shell prompt will reappear.
|
||||
</para>
|
||||
<para>
|
||||
All references to
|
||||
the database are removed, including the directory containing this
|
||||
database and its associated files.
|
||||
</para>
|
||||
<para>
|
||||
<application>destroydb</application> is a shell script that invokes
|
||||
<application>psql</application>.
|
||||
Hence, a <application>postmaster</application>
|
||||
process must be running on the database server host before
|
||||
<application>destroydb</application>
|
||||
is executed. The
|
||||
<envar>PGOPTION</envar>
|
||||
and
|
||||
<envar>PGREALM</envar>
|
||||
environment variables will be passed on to
|
||||
<application>psql</application>
|
||||
and processed as described in <xref endterm="app-psql-title" linkend="app-psql-title">.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-DESTROYDB-2">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To destroy the database <literal>demo</literal>
|
||||
using the postmaster on the local host, port 5432:
|
||||
<programlisting>
|
||||
destroydb demo
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
To destroy the database <literal>demo</literal>
|
||||
using the postmaster on host eden, port 5000:
|
||||
<programlisting>
|
||||
destroydb -p 5000 -h eden demo
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../reference.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
@ -1,172 +0,0 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/destroylang.sgml,v 1.1 1999/08/06 13:50:30 thomas Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
<refentry id="APP-DESTROYLANG">
|
||||
<refmeta>
|
||||
<refentrytitle id="APP-DESTROYLANG-TITLE">
|
||||
<application>destroylang</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname id="destroylang">
|
||||
<application>destroylang</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Add a programming language to a <productname>Postgres</productname> database
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-08-05</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
destroylang [ <replaceable class="parameter">langname</replaceable> ]
|
||||
destroylang [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ <replaceable class="parameter">langname</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-DESTROYLANG-1">
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
<application>destroylang</application> accepts the following command line arguments:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">langname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the backend programming language to be destroyed.
|
||||
<application>destroylang</application> will prompt for
|
||||
<replaceable class="parameter">langname</replaceable>
|
||||
if it is not specified on the command line.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<application>destroylang</application> also accepts
|
||||
the following command line arguments for connection parameters:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running. Defaults to using a local Unix domain socket
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections. The port number defaults to 5432,
|
||||
or the value of the <envar>PGPORT</envar>
|
||||
environment variable (if set).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<!--
|
||||
<varlistentry>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication.
|
||||
Prompts for
|
||||
<replaceable class="parameter">username</replaceable>
|
||||
and <replaceable class="parameter">password</replaceable>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
-->
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-APP-DESTROYLANG-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
<application>destroylang</application> removes an existing programming
|
||||
language from a <productname>Postgres</productname> server,
|
||||
so has not explicit external output.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 id="R1-APP-DESTROYLANG-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
|
||||
<para>
|
||||
<application>destroylang</application> is a utility for removing an
|
||||
existing programming language from a
|
||||
<productname>Postgres</productname> database.
|
||||
<application>destroylang</application> currently accepts two
|
||||
languages, <literal>plsql</literal> and <literal>pltcl</literal>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-DESTROYLANG-2">
|
||||
<title>
|
||||
Notes
|
||||
</title>
|
||||
|
||||
<para>
|
||||
See
|
||||
<xref linkend="sql-droplanguage" endterm="sql-droplanguage-title">
|
||||
for more details.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-DESTROYLANG-3">
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To remove <literal>pltcl</literal>:
|
||||
|
||||
<programlisting>
|
||||
% destroylang pltcl
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../reference.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
@ -1,259 +0,0 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/destroyuser.sgml,v 1.5 1999/07/22 15:09:10 thomas Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
<refentry id="APP-DESTROYUSER">
|
||||
<refmeta>
|
||||
<refentrytitle id="APP-DESTROYUSER-TITLE">
|
||||
<application>destroyuser</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>destroyuser</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Destroy a <productname>Postgres</productname> user and associated databases
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-07-20</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
destroyuser [ <replaceable class="parameter">username</replaceable> ]
|
||||
destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ <replaceable class="parameter">username</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-DESTROYUSER-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running. Defaults to using a local Unix domain socket
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections. The port number defaults to 5432,
|
||||
or the value of the <envar>PGPORT</envar>
|
||||
environment variable (if set).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the <productname>Postgres</productname> user to be removed.
|
||||
This name must exist in the <productname>Postgres</productname> installation.
|
||||
You will be prompted for a name if none is specified on the command line.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-APP-DESTROYUSER-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
<application>destroyuser</application> will remove an entry in the
|
||||
<literal>pg_user</literal> or <literal>pg_shadow</literal> system table,
|
||||
and will remove all databases for which that user is the administrator
|
||||
(<acronym>DBA</acronym>).
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
connectDB() failed: Is the postmaster running and accepting connections
|
||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||
destroyuser: database access failed.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>destroyuser</application> could not attach to the
|
||||
<application>postmaster</application>
|
||||
process on the specified host and port. If you see this message,
|
||||
ensure that the <application>postmaster</application>
|
||||
is running on the proper host and that you have specified the proper
|
||||
port. If your site uses an authentication system, ensure that you
|
||||
have obtained the required authentication credentials.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
destroyuser: database access failed.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||
and and will not be allowed to access <productname>Postgres</productname>. Contact your
|
||||
<productname>Postgres</productname> administrator.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
destroyuser: <replaceable class="parameter">username</replaceable> cannot delete users.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have permission to delete users; contact your
|
||||
<productname>Postgres</productname> site administrator.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
destroyuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The user to be added already has an entry in the
|
||||
<literal>pg_shadow</literal> class.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
database access failed
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
or in the backend server. Ensure that your site administrator has
|
||||
properly installed <productname>Postgres</productname>and initialized the site with
|
||||
<application>initdb</application>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
destroydb on <replaceable class="parameter">dbname</replaceable> failed - exiting
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
or in the backend server. There was possibly a Unix permissions problem with the
|
||||
specified database.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
delete of user <replaceable class="parameter">username</replaceable> was UNSUCCESSFUL
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
or in the backend server.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<application>destroyuser</application> internally runs
|
||||
<command>DROP USER</command> from <application>psql</application>
|
||||
while connected to the <literal>template1</literal> database.
|
||||
</para>
|
||||
</note>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 id="R1-APP-DESTROYUSER-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<application>destroyuser</application> removes an existing
|
||||
<productname>Postgres</productname> user
|
||||
and the databases for which that user
|
||||
is database administrator.
|
||||
Only users with <literal>usesuper</literal> set in
|
||||
the <literal>pg_shadow</literal> class can destroy
|
||||
<productname>Postgres</productname> users. As shipped,
|
||||
the user <literal>postgres</literal> can remove users.
|
||||
</para>
|
||||
<para>
|
||||
<application>destroyuser</application> is a shell script that invokes
|
||||
<application>psql</application>.
|
||||
Hence, a <application>postmaster</application>
|
||||
process must be running on the database server host before
|
||||
<application>destroyuser</application> is executed.
|
||||
The
|
||||
<envar>PGOPTION</envar>
|
||||
and
|
||||
<envar>PGREALM</envar>
|
||||
environment variables will be passed on to
|
||||
<application>psql</application>
|
||||
and processed as described in <xref endterm="app-psql-title" linkend="app-psql-title">.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once invoked, <application>destroyuser</application>
|
||||
will warn you about the databases that will be destroyed in the
|
||||
process and permit you to abort the removal of the user if desired.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../reference.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.7 1999/08/06 13:50:30 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.8 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -59,7 +59,7 @@ DROP DATABASE <replaceable class="PARAMETER">name</replaceable>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DESTROYDB
|
||||
DROP DATABASE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -116,14 +116,13 @@ WARN: destroydb: database "<replaceable class="parameter">name</replaceable>" do
|
||||
|
||||
<para>
|
||||
This query cannot be executed while connected to the target
|
||||
database. It is usually preferable to use
|
||||
<xref linkend="app-destroydb" endterm="app-destroydb-title">
|
||||
instead.
|
||||
database. Thus, it might be more convenient to use
|
||||
<xref linkend="app-dropdb" endterm="app-dropdb-title">
|
||||
from the shell instead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Refer to
|
||||
<xref linkend="app-createdb" endterm="app-createdb-title"> and
|
||||
<xref linkend="sql-createdatabase" endterm="sql-createdatabase-title">
|
||||
for information on how to create a database.
|
||||
</para>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.7 1999/07/22 15:09:11 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.8 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -95,7 +95,7 @@ ERROR: removeUser: user "<replaceable class="parameter">name</replaceable>" does
|
||||
along with any databases owned by the user. It
|
||||
does not remove tables, views, or triggers owned by the
|
||||
named user in databases not owned by the user. This statement
|
||||
can be used in place of the <application>destroyuser</application>
|
||||
can be used in place of the <application>dropuser</application>
|
||||
script, regardless of how the user was created.
|
||||
</para>
|
||||
|
||||
|
232
doc/src/sgml/ref/dropdb.sgml
Normal file
232
doc/src/sgml/ref/dropdb.sgml
Normal file
@ -0,0 +1,232 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.1 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
<refentry id="APP-DROPDB">
|
||||
<refmeta>
|
||||
<refentrytitle id="APP-DROPDB-TITLE">
|
||||
<application>dropdb</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>dropdb</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Remove an existing <productname>PostgreSQL</productname> database
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-11-07</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable class="parameter">dbname</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-DROPDB-1">
|
||||
<refsect2info>
|
||||
<date>1999-11-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h, --host <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p, --port <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-U, --username <replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Username to connect as.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-W, --password</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Force password prompt.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-e, --echo</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Echo the queries that <application>dropdb</application> generates
|
||||
and sends to the backend.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-q, --quiet</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Do not display a response.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-i, --interactive</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Issues a verification prompt before doing anything destructive.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the database to be removed. The database
|
||||
must be one of the existing <productname>PostgreSQL</productname> databases
|
||||
in this installation.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
The options <literal>-h</literal>, <literal>-p</literal>, <literal>-U</literal>,
|
||||
<literal>-W</literal>, and <literal>-e</literal> are passed on literally to
|
||||
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
|
||||
<refsect2 id="R2-APP-DROPDB-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>DROP DATABASE</computeroutput></term>
|
||||
<listitem>
|
||||
<para>The database was successfully removed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>dropdb: Database removal failed.</computeroutput></term>
|
||||
<listitem>
|
||||
<para>Something didn't work out.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
If there is an error condition, the backend error message will be displayed.
|
||||
See <xref linkend="SQL-DROPDATABASE" endterm="SQL-DROPDATABASE-title">
|
||||
and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 id="R1-APP-DROPDB-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<application>dropdb</application> destroys an existing
|
||||
<productname>PostgreSQL</productname> database.
|
||||
The user who executes this command must be a database
|
||||
superuser or the owner of the database.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<application>dropdb</application> is a shell script wrapper around the
|
||||
<acronym>SQL</acronym> command
|
||||
<xref linkend="SQL-DROPDATABASE" endterm="SQL-DROPDATABASE-title"> via
|
||||
the <productname>PostgreSQL</productname> interactive terminal
|
||||
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
|
||||
special about dropping databases via this or other methods. This means
|
||||
that the <application>psql</application> must be found by the script and that
|
||||
a database server is running at the targeted host. Also, any default
|
||||
settings and environment variables available to <application>psql</application>
|
||||
and the <application>libpq</application> front-end library do apply.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-DROPDB-2">
|
||||
<refsect1info>
|
||||
<date>1999-11-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To destroy the database <literal>demo</literal>
|
||||
on the default database server:
|
||||
<programlisting>
|
||||
$ <userinput>dropdb demo</userinput>
|
||||
DROP DATABASE
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
To destroy the database <literal>demo</literal>
|
||||
using the postmaster on host eden, port 5000, with verification
|
||||
and a peek at the underlying query:
|
||||
<programlisting>
|
||||
$ <userinput>dropdb -p 5000 -h eden -i -e demo</userinput>
|
||||
Database "demo" will be permanently deleted.
|
||||
Are you sure? (y/n) <userinput>y</userinput>
|
||||
QUERY: DROP DATABASE "demo"
|
||||
DROP DATABASE
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../reference.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
227
doc/src/sgml/ref/dropuser.sgml
Normal file
227
doc/src/sgml/ref/dropuser.sgml
Normal file
@ -0,0 +1,227 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.1 1999/12/04 04:53:15 momjian Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
<refentry id="APP-DROPUSER">
|
||||
<refmeta>
|
||||
<refentrytitle id="APP-DROPUSER-TITLE">
|
||||
<application>dropuser</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>dropuser</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Drops (removes) a <productname>Postgres</productname> user
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-11-07</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable class="parameter">username</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<refsect2 id="R2-APP-DROPUSER-1">
|
||||
<refsect2info>
|
||||
<date>1999-11-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-h, --host <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
<application>postmaster</application>
|
||||
is running.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p, --port <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
extension on which the <application>postmaster</application>
|
||||
is listening for connections.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-e, --echo</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Echo the queries that <application>createdb</application> generates
|
||||
and sends to the backend.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-q, --quiet</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Do not display a response.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-i, --interactive</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prompt for confirmation before actually removing the user.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the <productname>PostgreSQL</productname> user to be removed.
|
||||
This name must exist in the <productname>Postgres</productname> installation.
|
||||
You will be prompted for a name if none is specified on the command line.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The options <literal>-h</literal>, <literal>-p</literal>, and <literal>-e</literal>,
|
||||
are passed on literally to <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. If you
|
||||
need the <application>psql</application> options <literal>-U</literal> and
|
||||
<literal>-W</literal> as well, you can uncomment the
|
||||
respective lines in the source. They are disabled by default because of the potential
|
||||
conceptual confusion between existing and new users.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-APP-DROPUSER-2">
|
||||
<refsect2info>
|
||||
<date>1999-11-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>DROP USER</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
All is well.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>dropuser: Deletion of user "<replaceable class="parameter">username</replaceable>" failed.</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Something went wrong. The user was not removed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
If there is an error condition, the backend error message will be displayed.
|
||||
See <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title">
|
||||
and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 id="R1-APP-DROPUSER-1">
|
||||
<refsect1info>
|
||||
<date>1999-11-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<application>dropuser</application> removes an existing
|
||||
<productname>PostgreSQL</productname> user
|
||||
<emphasis>and</emphasis> the databases which that user owned.
|
||||
Only users with <literal>usesuper</literal> set in
|
||||
the <literal>pg_shadow</literal> class can destroy
|
||||
<productname>PostgreSQL</productname> users.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<application>dropuser</application> is a shell script wrapper around the
|
||||
<acronym>SQL</acronym> command
|
||||
<xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title"> via
|
||||
the <productname>PostgreSQL</productname> interactive terminal
|
||||
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
|
||||
special about removing users via this or other methods. This means
|
||||
that the <application>psql</application> must be found by the script and that
|
||||
a database server is running at the targeted host. Also, any default
|
||||
settings and environment variables available to <application>psql</application>
|
||||
and the <application>libpq</application> front-end library do apply.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-APP-DROPUSER-2">
|
||||
<refsect1info>
|
||||
<date>1999-11-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To remove user <literal>joe</literal>
|
||||
from the default database server:
|
||||
<programlisting>
|
||||
$ <userinput>dropuser joe</userinput>
|
||||
DROP USER
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To remove user <literal>joe</literal>
|
||||
using the postmaster on host eden, port 5000, with verification
|
||||
and a peek at the underlying query:
|
||||
<programlisting>
|
||||
$ <userinput>dropuser -p 5000 -h eden -i -e joe</userinput>
|
||||
User "joe" and any owned databases will be permanently deleted.
|
||||
Are you sure? (y/n) <userinput>y</userinput>
|
||||
QUERY: DROP USER "joe"
|
||||
DROP USER
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../reference.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
Reference in New Issue
Block a user