mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Okay, that should put us back in sync. These two patches (src & doc) are
against the sources from one hour ago and contain all the portable and up to date stuff. A few other CVS "householding" things you might want to take care of: * Remove the src/bin/cleardbdir directory * Remove the file src/bin/psql/sql_help.h from the repository, as it is a derived file and is build by the release_prep. Peter Eisentraut
This commit is contained in:
		@@ -808,7 +808,7 @@ $ nohup postmaster -i > pgserver.log 2>&1 &
 | 
				
			|||||||
<para>
 | 
					<para>
 | 
				
			||||||
Create a database by typing
 | 
					Create a database by typing
 | 
				
			||||||
<ProgramListing>
 | 
					<ProgramListing>
 | 
				
			||||||
$ createdb
 | 
					$ createdb test
 | 
				
			||||||
</ProgramListing>
 | 
					</ProgramListing>
 | 
				
			||||||
</para>
 | 
					</para>
 | 
				
			||||||
</step>
 | 
					</step>
 | 
				
			||||||
@@ -816,7 +816,7 @@ $ createdb
 | 
				
			|||||||
<para>
 | 
					<para>
 | 
				
			||||||
Connect to the new database:
 | 
					Connect to the new database:
 | 
				
			||||||
<ProgramListing>
 | 
					<ProgramListing>
 | 
				
			||||||
$ psql
 | 
					$ psql test
 | 
				
			||||||
</ProgramListing>
 | 
					</ProgramListing>
 | 
				
			||||||
</para>
 | 
					</para>
 | 
				
			||||||
</step>
 | 
					</step>
 | 
				
			||||||
@@ -840,7 +840,7 @@ postgres=> \q
 | 
				
			|||||||
<para>
 | 
					<para>
 | 
				
			||||||
Remove the test database (unless you will want to use it later for other tests):
 | 
					Remove the test database (unless you will want to use it later for other tests):
 | 
				
			||||||
<ProgramListing>
 | 
					<ProgramListing>
 | 
				
			||||||
$ destroydb
 | 
					$ dropdb test
 | 
				
			||||||
</ProgramListing>
 | 
					</ProgramListing>
 | 
				
			||||||
</para>
 | 
					</para>
 | 
				
			||||||
</step>
 | 
					</step>
 | 
				
			||||||
@@ -1028,7 +1028,7 @@ For example,
 | 
				
			|||||||
     After running the regression tests, type
 | 
					     After running the regression tests, type
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<ProgramListing>
 | 
					<ProgramListing>
 | 
				
			||||||
$ destroydb regression
 | 
					$ dropdb regression
 | 
				
			||||||
$ cd /usr/src/pgsql/postgresql-6.5.3/src/test/regress
 | 
					$ cd /usr/src/pgsql/postgresql-6.5.3/src/test/regress
 | 
				
			||||||
$ gmake clean
 | 
					$ gmake clean
 | 
				
			||||||
</ProgramListing>
 | 
					</ProgramListing>
 | 
				
			||||||
@@ -1241,7 +1241,7 @@ Create the database foo:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<ProgramListing>
 | 
					<ProgramListing>
 | 
				
			||||||
template1=> create database foo;
 | 
					template1=> create database foo;
 | 
				
			||||||
CREATEDB
 | 
					CREATE DATABASE
 | 
				
			||||||
</ProgramListing>
 | 
					</ProgramListing>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(Get in the habit of including those SQL semicolons.  Psql won't execute
 | 
					(Get in the habit of including those SQL semicolons.  Psql won't execute
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -143,7 +143,7 @@ You are currently connected to the database: <replaceable>dbname</replaceable>
 | 
				
			|||||||
    mydb,  you can destroy it using the following Unix command:
 | 
					    mydb,  you can destroy it using the following Unix command:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <programlisting>
 | 
					    <programlisting>
 | 
				
			||||||
% destroydb <replaceable class="parameter">dbname</replaceable>
 | 
					% dropdb <replaceable class="parameter">dbname</replaceable>
 | 
				
			||||||
    </programlisting>
 | 
					    </programlisting>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This action physically removes all of  the  Unix  files
 | 
					    This action physically removes all of  the  Unix  files
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -283,7 +283,7 @@ TBD
 | 
				
			|||||||
     If you are the database administrator for the  database
 | 
					     If you are the database administrator for the  database
 | 
				
			||||||
     <Database>mydb</Database>,  you can destroy it using the following Unix command:
 | 
					     <Database>mydb</Database>,  you can destroy it using the following Unix command:
 | 
				
			||||||
<ProgramListing>
 | 
					<ProgramListing>
 | 
				
			||||||
% destroydb mydb
 | 
					% dropdb mydb
 | 
				
			||||||
</ProgramListing>
 | 
					</ProgramListing>
 | 
				
			||||||
     This action physically removes all of  the  Unix  files
 | 
					     This action physically removes all of  the  Unix  files
 | 
				
			||||||
     associated  with  the database and cannot be undone, so
 | 
					     associated  with  the database and cannot be undone, so
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.7 1999/12/04 04:53:15 momjian Exp $
 | 
					$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.8 1999/12/07 22:41:41 momjian Exp $
 | 
				
			||||||
Postgres documentation
 | 
					Postgres documentation
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -96,7 +96,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c
 | 
				
			|||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term>-D, --dbpath <replaceable class="parameter">datadir</replaceable></term>
 | 
					      <term>-D, --location <replaceable class="parameter">datadir</replaceable></term>
 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Specifies the alternate database location for this database installation.
 | 
						Specifies the alternate database location for this database installation.
 | 
				
			||||||
@@ -120,7 +120,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c
 | 
				
			|||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Specifies the name of the database to be created.  The name must be
 | 
						Specifies the name of the database to be created.  The name must be
 | 
				
			||||||
	unique among all <productname>Postgres</productname> databases in this installation.
 | 
						unique among all <productname>PostgreSQL</productname> databases in this installation.
 | 
				
			||||||
       </para>
 | 
					       </para>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
@@ -167,7 +167,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c
 | 
				
			|||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term><computeroutput>createdb: Comment creation failed.</computeroutput></term>
 | 
					      <term><computeroutput>createdb: Comment creation failed. (Database was created.)</computeroutput></term>
 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
       The comment/description for the database could not be created.
 | 
					       The comment/description for the database could not be created.
 | 
				
			||||||
@@ -235,11 +235,11 @@ CREATE DATABASE
 | 
				
			|||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
   To create the database <literal>demo</literal>
 | 
					   To create the database <literal>demo</literal>
 | 
				
			||||||
   using the postmaster on host eden, port 5000, using the <literal>LATIN1</literal>
 | 
					   using the postmaster on host eden, port 5000, using the <literal>LATIN1</literal>
 | 
				
			||||||
   encoding scheme and look at the underlying query:
 | 
					   encoding scheme with a look at the underlying query:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   <programlisting>
 | 
					   <programlisting>
 | 
				
			||||||
$ <userinput>createdb -p 5000 -h eden -E LATIN1 -e demo</userinput>
 | 
					$ <userinput>createdb -p 5000 -h eden -E LATIN1 -e demo</userinput>
 | 
				
			||||||
QUERY: CREATE DATABASE "demo" WITH ENCODING = 'LATIN1'
 | 
					CREATE DATABASE "demo" WITH ENCODING = 'LATIN1'
 | 
				
			||||||
CREATE DATABASE
 | 
					CREATE DATABASE
 | 
				
			||||||
   </programlisting>
 | 
					   </programlisting>
 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.6 1999/12/04 04:53:15 momjian Exp $
 | 
					$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.7 1999/12/07 22:41:41 momjian Exp $
 | 
				
			||||||
Postgres documentation
 | 
					Postgres documentation
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -125,6 +125,16 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab
 | 
				
			|||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     <varlistentry>
 | 
				
			||||||
 | 
					      <term>-i, --sysid <replaceable class="parameter">uid</replaceable></term>
 | 
				
			||||||
 | 
					      <listitem>
 | 
				
			||||||
 | 
					       <para>
 | 
				
			||||||
 | 
					       Allows you to pick a non-default user id for the new user. This is not
 | 
				
			||||||
 | 
					       necessary, but some people like it.
 | 
				
			||||||
 | 
					       </para>
 | 
				
			||||||
 | 
					      </listitem>
 | 
				
			||||||
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term><replaceable class="parameter">username</replaceable></term>
 | 
					      <term><replaceable class="parameter">username</replaceable></term>
 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
@@ -142,11 +152,9 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    <para>
 | 
					    <para>
 | 
				
			||||||
    The options <literal>-h</literal>, <literal>-p</literal>, and <literal>-e</literal>,
 | 
					    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
 | 
					    are passed on literally to <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. The
 | 
				
			||||||
    need the <application>psql</application> options <literal>-U</literal> and
 | 
					    <application>psql</application> options <literal>-U</literal> and <literal>-W</literal>
 | 
				
			||||||
    <literal>-W</literal> as well, you can uncomment the
 | 
					    are available as well, but their use can be confusing in this context.
 | 
				
			||||||
    respective lines in the source. They are disabled by default because of the potential
 | 
					 | 
				
			||||||
    conceptual confusion between existing and new users.
 | 
					 | 
				
			||||||
   </para>
 | 
					   </para>
 | 
				
			||||||
  </refsect2>
 | 
					  </refsect2>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -243,7 +251,7 @@ CREATE USER
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
   <programlisting>
 | 
					   <programlisting>
 | 
				
			||||||
$ <userinput>createuser -p 5000 -h eden -D -A -e joe</userinput>
 | 
					$ <userinput>createuser -p 5000 -h eden -D -A -e joe</userinput>
 | 
				
			||||||
QUERY: CREATE USER "joe" NOCREATEDB NOCREATEUSER
 | 
					CREATE USER "joe" NOCREATEDB NOCREATEUSER
 | 
				
			||||||
CREATE USER
 | 
					CREATE USER
 | 
				
			||||||
   </programlisting>
 | 
					   </programlisting>
 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.8 1999/12/04 04:53:15 momjian Exp $
 | 
					$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.9 1999/12/07 22:41:41 momjian Exp $
 | 
				
			||||||
Postgres documentation
 | 
					Postgres documentation
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -94,9 +94,7 @@ ERROR: removeUser: user "<replaceable class="parameter">name</replaceable>" does
 | 
				
			|||||||
   user from the database,
 | 
					   user from the database,
 | 
				
			||||||
   along with any databases owned by the user. It
 | 
					   along with any databases owned by the user. It
 | 
				
			||||||
   does not remove tables, views, or triggers owned by the
 | 
					   does not remove tables, views, or triggers owned by the
 | 
				
			||||||
   named user in databases not owned by the user. This statement
 | 
					   named user in databases not owned by the user.
 | 
				
			||||||
   can be used in place of the <application>dropuser</application>
 | 
					 | 
				
			||||||
   script, regardless of how the user was created.
 | 
					 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <refsect2 id="R2-SQL-DROPUSER-3">
 | 
					  <refsect2 id="R2-SQL-DROPUSER-3">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.1 1999/12/04 04:53:15 momjian Exp $
 | 
					$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.2 1999/12/07 22:41:41 momjian Exp $
 | 
				
			||||||
Postgres documentation
 | 
					Postgres documentation
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -207,7 +207,7 @@ DROP DATABASE
 | 
				
			|||||||
$ <userinput>dropdb -p 5000 -h eden -i -e demo</userinput>
 | 
					$ <userinput>dropdb -p 5000 -h eden -i -e demo</userinput>
 | 
				
			||||||
Database "demo" will be permanently deleted.
 | 
					Database "demo" will be permanently deleted.
 | 
				
			||||||
Are you sure? (y/n) <userinput>y</userinput>
 | 
					Are you sure? (y/n) <userinput>y</userinput>
 | 
				
			||||||
QUERY: DROP DATABASE "demo"
 | 
					DROP DATABASE "demo"
 | 
				
			||||||
DROP DATABASE
 | 
					DROP DATABASE
 | 
				
			||||||
   </programlisting>
 | 
					   </programlisting>
 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.1 1999/12/04 04:53:15 momjian Exp $
 | 
					$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.2 1999/12/07 22:41:41 momjian Exp $
 | 
				
			||||||
Postgres documentation
 | 
					Postgres documentation
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -101,11 +101,9 @@ dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    <para>
 | 
					    <para>
 | 
				
			||||||
    The options <literal>-h</literal>, <literal>-p</literal>, and <literal>-e</literal>,
 | 
					    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
 | 
					    are passed on literally to <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. The
 | 
				
			||||||
    need the <application>psql</application> options <literal>-U</literal> and
 | 
					    <application>psql</application> options <literal>-U</literal> and <literal>-W</literal>
 | 
				
			||||||
    <literal>-W</literal> as well, you can uncomment the
 | 
					    are available as well, but they can be confusing in this context.
 | 
				
			||||||
    respective lines in the source. They are disabled by default because of the potential
 | 
					 | 
				
			||||||
    conceptual confusion between existing and new users.
 | 
					 | 
				
			||||||
   </para>
 | 
					   </para>
 | 
				
			||||||
  </refsect2>
 | 
					  </refsect2>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -201,7 +199,7 @@ DROP USER
 | 
				
			|||||||
$ <userinput>dropuser -p 5000 -h eden -i -e joe</userinput>
 | 
					$ <userinput>dropuser -p 5000 -h eden -i -e joe</userinput>
 | 
				
			||||||
User "joe" and any owned databases will be permanently deleted.
 | 
					User "joe" and any owned databases will be permanently deleted.
 | 
				
			||||||
Are you sure? (y/n) <userinput>y</userinput>
 | 
					Are you sure? (y/n) <userinput>y</userinput>
 | 
				
			||||||
QUERY: DROP USER "joe"
 | 
					DROP USER "joe"
 | 
				
			||||||
DROP USER
 | 
					DROP USER
 | 
				
			||||||
   </programlisting>
 | 
					   </programlisting>
 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.6 1999/11/28 02:17:04 tgl Exp $
 | 
					$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.7 1999/12/07 22:41:41 momjian Exp $
 | 
				
			||||||
Postgres documentation
 | 
					Postgres documentation
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,7 +24,7 @@ Postgres documentation
 | 
				
			|||||||
  </refsynopsisdivinfo>
 | 
					  </refsynopsisdivinfo>
 | 
				
			||||||
  <synopsis>
 | 
					  <synopsis>
 | 
				
			||||||
VACUUM [ VERBOSE ] [ ANALYZE ] [ <replaceable class="PARAMETER">table</replaceable> ]
 | 
					VACUUM [ VERBOSE ] [ ANALYZE ] [ <replaceable class="PARAMETER">table</replaceable> ]
 | 
				
			||||||
VACUUM [ VERBOSE ] ANALYZE [ <replaceable class="PARAMETER">ER">t</replaceable>BLE> [ (<replaceable class="PARAMETER">column</replaceable> [, ...] ) ] ]
 | 
					VACUUM [ VERBOSE ] ANALYZE [ <replaceable class="PARAMETER">table</replaceable> [ (<replaceable class="PARAMETER">column</replaceable> [, ...] ) ] ]
 | 
				
			||||||
  </synopsis>
 | 
					  </synopsis>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <refsect2 id="R2-SQL-VACUUM-1">
 | 
					  <refsect2 id="R2-SQL-VACUUM-1">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.5 1999/07/22 15:09:15 thomas Exp $
 | 
					$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.6 1999/12/07 22:41:41 momjian Exp $
 | 
				
			||||||
Postgres documentation
 | 
					Postgres documentation
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -15,23 +15,21 @@ Postgres documentation
 | 
				
			|||||||
   <application>vacuumdb</application>
 | 
					   <application>vacuumdb</application>
 | 
				
			||||||
  </refname>
 | 
					  </refname>
 | 
				
			||||||
  <refpurpose>
 | 
					  <refpurpose>
 | 
				
			||||||
   Clean and analyze a <productname>Postgres</productname> database
 | 
					   Clean and analyze a <productname>PostgreSQL</productname> database
 | 
				
			||||||
  </refpurpose>
 | 
					  </refpurpose>
 | 
				
			||||||
 </refnamediv>
 | 
					 </refnamediv>
 | 
				
			||||||
 <refsynopsisdiv>
 | 
					 <refsynopsisdiv>
 | 
				
			||||||
  <refsynopsisdivinfo>
 | 
					  <refsynopsisdivinfo>
 | 
				
			||||||
   <date>1998-10-04</date>
 | 
					   <date>1999-12-04</date>
 | 
				
			||||||
  </refsynopsisdivinfo>
 | 
					  </refsynopsisdivinfo>
 | 
				
			||||||
  <synopsis>
 | 
					  <synopsis>
 | 
				
			||||||
vacuumdb [ --analyze | -z ] [ --verbose | -v ] [ <replaceable class="parameter">dbname</replaceable> ]
 | 
					vacuumdb [ <replaceable class="parameter">connection options</replaceable> ] [ --analyze | -z ] [ --verbose | -v ]
 | 
				
			||||||
vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
 | 
					         [ --table '<replaceable class="parameter">table</replaceable> [ ( <replaceable class="parameter">column</replaceable> [,...] ) ]' ] [ [-d] <replaceable class="parameter">dbname</replaceable> ]
 | 
				
			||||||
    [ --table '<replaceable class="parameter">table</replaceable> [ ( <replaceable class="parameter">column</replaceable> [,...] ) ]' ]
 | 
					 | 
				
			||||||
    [ <replaceable class="parameter">dbname</replaceable> ]
 | 
					 | 
				
			||||||
  </synopsis>
 | 
					  </synopsis>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <refsect2 id="R2-APP-VACUUMDB-1">
 | 
					  <refsect2 id="R2-APP-VACUUMDB-1">
 | 
				
			||||||
   <refsect2info>
 | 
					   <refsect2info>
 | 
				
			||||||
    <date>1998-10-04</date>
 | 
					    <date>1999-12-04</date>
 | 
				
			||||||
   </refsect2info>
 | 
					   </refsect2info>
 | 
				
			||||||
   <title>
 | 
					   <title>
 | 
				
			||||||
    Inputs
 | 
					    Inputs
 | 
				
			||||||
@@ -41,21 +39,16 @@ vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replacea
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    <variablelist>
 | 
					    <variablelist>
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term><replaceable class="parameter">dbname</replaceable></term>
 | 
					      <term>[-d, --dbname] <replaceable class="parameter">dbname</replaceable></term>
 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Specifies the name of the database to be cleaned or analyzed.
 | 
						Specifies the name of the database to be cleaned or analyzed.
 | 
				
			||||||
	<replaceable class="parameter">dbname</replaceable>
 | 
					 | 
				
			||||||
	defaults to the value of the
 | 
					 | 
				
			||||||
	<envar>USER</envar>
 | 
					 | 
				
			||||||
	environment variable.
 | 
					 | 
				
			||||||
       </para>
 | 
					       </para>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term>--analyze</term>
 | 
					      <term>-z, --analyze</term>
 | 
				
			||||||
      <term>-z</term>
 | 
					 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Calculate statistics on the database for use by the optimizer.
 | 
						Calculate statistics on the database for use by the optimizer.
 | 
				
			||||||
@@ -64,8 +57,7 @@ vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replacea
 | 
				
			|||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term>--verbose</term>
 | 
					      <term>-v, --verbose</term>
 | 
				
			||||||
      <term>-v</term>
 | 
					 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Print detailed information during processing.
 | 
						Print detailed information during processing.
 | 
				
			||||||
@@ -74,14 +66,19 @@ vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replacea
 | 
				
			|||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term>--table <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]</term>
 | 
					      <term>-t, --table <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]</term>
 | 
				
			||||||
      <term>-t <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]</term>
 | 
					 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Clean or analyze <replaceable class="parameter">table</replaceable> only.
 | 
						Clean or analyze <replaceable class="parameter">table</replaceable> only.
 | 
				
			||||||
	Column names may be specified only in conjunction with
 | 
						Column names may be specified only in conjunction with
 | 
				
			||||||
	the <option>--analyze</option> option.
 | 
						the <option>--analyze</option> option.
 | 
				
			||||||
       </para>
 | 
					       </para>
 | 
				
			||||||
 | 
					       <tip>
 | 
				
			||||||
 | 
					        <para>
 | 
				
			||||||
 | 
					         If you specify columns to vacuum, you probably have to escape the parentheses
 | 
				
			||||||
 | 
					         from the shell.
 | 
				
			||||||
 | 
					        </para>
 | 
				
			||||||
 | 
					       </tip>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -94,38 +91,60 @@ vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replacea
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    <variablelist>
 | 
					    <variablelist>
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term>-h <replaceable class="parameter">host</replaceable></term>
 | 
					      <term>-h, --host <replaceable class="parameter">host</replaceable></term>
 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Specifies the hostname of the machine on which the 
 | 
						Specifies the hostname of the machine on which the 
 | 
				
			||||||
	<application>postmaster</application>
 | 
						<application>postmaster</application>
 | 
				
			||||||
	is running.  Defaults to using a local Unix domain socket
 | 
						is running.
 | 
				
			||||||
	rather than an IP connection..
 | 
					 | 
				
			||||||
       </para>
 | 
					       </para>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term>-p <replaceable class="parameter">port</replaceable></term>
 | 
					      <term>-p, --port <replaceable class="parameter">port</replaceable></term>
 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Specifies the Internet TCP/IP port or local Unix domain socket file 
 | 
						Specifies the Internet TCP/IP port or local Unix domain socket file 
 | 
				
			||||||
	extension on which the <application>postmaster</application>
 | 
						extension on which the <application>postmaster</application>
 | 
				
			||||||
	is listening for connections.  The port number defaults to 5432,
 | 
						is listening for connections.
 | 
				
			||||||
	or the value of the <envar>PGPORT</envar>
 | 
					 | 
				
			||||||
	environment variable (if set).
 | 
					 | 
				
			||||||
       </para>
 | 
					       </para>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term>-u</term>
 | 
					      <term>-U, --username <replaceable class="parameter">username</replaceable></term>
 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	Use password authentication. 
 | 
					        Username to connect as.
 | 
				
			||||||
	Prompts for
 | 
					       </para>
 | 
				
			||||||
	<replaceable class="parameter">username</replaceable>
 | 
					      </listitem>
 | 
				
			||||||
	and <replaceable class="parameter">password</replaceable>.
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     <varlistentry>
 | 
				
			||||||
 | 
					      <term>-W, --password</term>
 | 
				
			||||||
 | 
					      <listitem>
 | 
				
			||||||
 | 
					       <para>
 | 
				
			||||||
 | 
					        Force password prompt.
 | 
				
			||||||
 | 
					       </para>
 | 
				
			||||||
 | 
					      </listitem>
 | 
				
			||||||
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     <varlistentry>
 | 
				
			||||||
 | 
					      <term>-e, --echo</term>
 | 
				
			||||||
 | 
					      <listitem>
 | 
				
			||||||
 | 
					       <para>
 | 
				
			||||||
 | 
					        Echo the commands that <application>vacuumdb</application> generates
 | 
				
			||||||
 | 
						and sends to the backend.
 | 
				
			||||||
 | 
					       </para>
 | 
				
			||||||
 | 
					      </listitem>
 | 
				
			||||||
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     <varlistentry>
 | 
				
			||||||
 | 
					      <term>-q, --quiet</term>
 | 
				
			||||||
 | 
					      <listitem>
 | 
				
			||||||
 | 
					       <para>
 | 
				
			||||||
 | 
					        Do not display a response.
 | 
				
			||||||
       </para>
 | 
					       </para>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
@@ -135,79 +154,46 @@ vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replacea
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  <refsect2 id="R2-APP-VACUUMDB-2">
 | 
					  <refsect2 id="R2-APP-VACUUMDB-2">
 | 
				
			||||||
   <refsect2info>
 | 
					   <refsect2info>
 | 
				
			||||||
    <date>1998-10-04</date>
 | 
					    <date>1999-12-04</date>
 | 
				
			||||||
   </refsect2info>
 | 
					   </refsect2info>
 | 
				
			||||||
   <title>
 | 
					   <title>
 | 
				
			||||||
    Outputs
 | 
					    Outputs
 | 
				
			||||||
   </title>
 | 
					   </title>
 | 
				
			||||||
   <para>
 | 
					   <para>
 | 
				
			||||||
    <application>vacuumdb</application> executes a <command>VACUUM</command> command
 | 
					 | 
				
			||||||
    on the specified database, so has not explicit external output.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <variablelist>
 | 
					    <variablelist>
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term><computeroutput>
 | 
					      <term><computeroutput>VACUUM</computeroutput></term>
 | 
				
			||||||
ERROR:  Can't vacuum columns, only tables.  You can 'vacuum analyze' columns.
 | 
					 | 
				
			||||||
vacuumdb: database vacuum failed on <replaceable class="parameter">dbname</replaceable>.
 | 
					 | 
				
			||||||
       </computeroutput></term>
 | 
					 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	The non-analyze mode requires cleaning full tables or databases.
 | 
					        Everything went well.
 | 
				
			||||||
	Individual columns may be specified only when analyzing a specific table.
 | 
					 | 
				
			||||||
       </para>
 | 
					       </para>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					     <varlistentry>
 | 
				
			||||||
      <term><computeroutput>
 | 
					      <term><computeroutput>vacuumdb: Vacuum failed.</computeroutput></term>
 | 
				
			||||||
Connection to database 'template1' failed.
 | 
					 | 
				
			||||||
connectDB() failed: Is the postmaster running and accepting connections
 | 
					 | 
				
			||||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
 | 
					 | 
				
			||||||
       </computeroutput></term>
 | 
					 | 
				
			||||||
      <listitem>
 | 
					      <listitem>
 | 
				
			||||||
       <para>
 | 
					       <para>
 | 
				
			||||||
	<application>vacuumdb</application> could not attach to the 
 | 
					        Something went wrong. <application>vacuumdb</application> is only a wrapper
 | 
				
			||||||
	<application>postmaster</application> 
 | 
					        script. See <xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title">
 | 
				
			||||||
	process on the specified host and port.  If you see this message,
 | 
					        and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for a detailed
 | 
				
			||||||
	ensure that the <application>postmaster</application> 
 | 
					        discussion of error messages and potential problems.
 | 
				
			||||||
	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>
 | 
				
			||||||
      </listitem>
 | 
					      </listitem>
 | 
				
			||||||
     </varlistentry>
 | 
					     </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <varlistentry>
 | 
					 | 
				
			||||||
      <term><computeroutput>
 | 
					 | 
				
			||||||
Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
 | 
					 | 
				
			||||||
FATAL 1:  SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
 | 
					 | 
				
			||||||
       </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>
 | 
					 | 
				
			||||||
    </variablelist>
 | 
					    </variablelist>
 | 
				
			||||||
   </para>
 | 
					   </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   <note>
 | 
					   <para>
 | 
				
			||||||
    <para>
 | 
					   </para>
 | 
				
			||||||
     <application>vacuumdb</application> internally executes a
 | 
					
 | 
				
			||||||
     <command>VACUUM</command> <acronym>SQL</acronym> statement. 
 | 
					 | 
				
			||||||
     If you have problems running <application>vacuumdb</application>,
 | 
					 | 
				
			||||||
     make sure you are able to run <command>VACUUM</command> on the database using, for
 | 
					 | 
				
			||||||
     example, <application>psql</application>.
 | 
					 | 
				
			||||||
    </para>
 | 
					 | 
				
			||||||
   </note>
 | 
					 | 
				
			||||||
  </refsect2>
 | 
					  </refsect2>
 | 
				
			||||||
 </refsynopsisdiv>
 | 
					 </refsynopsisdiv>
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 <refsect1 id="R1-APP-VACUUMDB-1">
 | 
					 <refsect1 id="R1-APP-VACUUMDB-1">
 | 
				
			||||||
  <refsect1info>
 | 
					  <refsect1info>
 | 
				
			||||||
   <date>1998-10-04</date>
 | 
					   <date>1999-12-04</date>
 | 
				
			||||||
  </refsect1info>
 | 
					  </refsect1info>
 | 
				
			||||||
  <title>
 | 
					  <title>
 | 
				
			||||||
   Description
 | 
					   Description
 | 
				
			||||||
@@ -215,25 +201,26 @@ FATAL 1:  SetUserId: user '<replaceable class="parameter">username</replaceable>
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
   <application>vacuumdb</application> is a utility for cleaning a
 | 
					   <application>vacuumdb</application> is a utility for cleaning a
 | 
				
			||||||
   <productname>Postgres</productname> database.
 | 
					   <productname>PostgreSQL</productname> database.
 | 
				
			||||||
   <application>vacuumdb</application> will also generate internal statistics
 | 
					   <application>vacuumdb</application> will also generate internal statistics
 | 
				
			||||||
   used by the <productname>Postgres</productname> query optimizer.
 | 
					   used by the <productname>Postgres</productname> query optimizer.
 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 </refsect1>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 <refsect1 id="R1-APP-VACUUMDB-2">
 | 
					 | 
				
			||||||
  <refsect1info>
 | 
					 | 
				
			||||||
   <date>1998-10-04</date>
 | 
					 | 
				
			||||||
  </refsect1info>
 | 
					 | 
				
			||||||
  <title>
 | 
					 | 
				
			||||||
   Notes
 | 
					 | 
				
			||||||
  </title>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
   See <xref endterm="sql-vacuum-title" linkend="sql-vacuum-title"> for more details.
 | 
					   <application>vacuumdb</application> is a shell script wrapper around the
 | 
				
			||||||
 | 
					   backend command
 | 
				
			||||||
 | 
					   <xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title"> via
 | 
				
			||||||
 | 
					   the <productname>PostgreSQL</productname> interactive terminal
 | 
				
			||||||
 | 
					   <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. There is no effective
 | 
				
			||||||
 | 
					   difference between vacuuming databases via this or other methods.
 | 
				
			||||||
 | 
					   <application>psql</application> must be found by the script and
 | 
				
			||||||
 | 
					   a database server must be 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>
 | 
					  </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 </refsect1>
 | 
					 </refsect1>
 | 
				
			||||||
 
 | 
					
 | 
				
			||||||
 <refsect1 id="R1-APP-VACUUMDB-3">
 | 
					 <refsect1 id="R1-APP-VACUUMDB-3">
 | 
				
			||||||
  <refsect1info>
 | 
					  <refsect1info>
 | 
				
			||||||
   <date>1998-10-04</date>
 | 
					   <date>1998-10-04</date>
 | 
				
			||||||
@@ -241,29 +228,29 @@ FATAL 1:  SetUserId: user '<replaceable class="parameter">username</replaceable>
 | 
				
			|||||||
  <title>
 | 
					  <title>
 | 
				
			||||||
   Usage
 | 
					   Usage
 | 
				
			||||||
  </title>
 | 
					  </title>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
   To clean a database of the same name as the user:
 | 
					   To clean the database <literal>test</literal>:
 | 
				
			||||||
   
 | 
					<programlisting>
 | 
				
			||||||
   <programlisting>
 | 
					$ vacuumdb test
 | 
				
			||||||
% vacuumdb
 | 
					</programlisting>
 | 
				
			||||||
   </programlisting>
 | 
					 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
   To analyze a database named <literal>bigdb</literal> for the optimizer:
 | 
					   To analyze a database named <literal>bigdb</literal> for the optimizer:
 | 
				
			||||||
 | 
					<programlisting>
 | 
				
			||||||
   <programlisting>
 | 
					$ vacuumdb --analyze bigdb
 | 
				
			||||||
% vacuumdb --analyze bigdb
 | 
					</programlisting>
 | 
				
			||||||
   </programlisting>
 | 
					 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
   To analyze a single column <literal>bar</literal> in table <literal>foo</literal>
 | 
					   To analyze a single column <literal>bar</literal> in table <literal>foo</literal>
 | 
				
			||||||
   in a database named <literal>xyzzy</literal> for the optimizer:
 | 
					   in a database named <literal>xyzzy</literal> for the optimizer:
 | 
				
			||||||
 | 
					<programlisting>
 | 
				
			||||||
   <programlisting>
 | 
					$ vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy
 | 
				
			||||||
% vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy
 | 
					</programlisting>
 | 
				
			||||||
   </programlisting>
 | 
					 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 </refsect1>
 | 
					 </refsect1>
 | 
				
			||||||
</refentry>
 | 
					</refentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -246,7 +246,7 @@ The runtime path is /usr/local/pgsql (other paths are possible).
 | 
				
			|||||||
	<Para>
 | 
						<Para>
 | 
				
			||||||
	  After running the tests and examining the results, type
 | 
						  After running the tests and examining the results, type
 | 
				
			||||||
	  <ProgramListing>
 | 
						  <ProgramListing>
 | 
				
			||||||
	    destroydb regression
 | 
						    dropdb regression
 | 
				
			||||||
	    cd /usr/src/pgsql/src/test/regress
 | 
						    cd /usr/src/pgsql/src/test/regress
 | 
				
			||||||
	    gmake clean
 | 
						    gmake clean
 | 
				
			||||||
	  </ProgramListing>
 | 
						  </ProgramListing>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@
 | 
				
			|||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
   <application>createuser</application> enables specific users to access
 | 
					   <application>createuser</application> enables specific users to access
 | 
				
			||||||
   <productname>Postgres</productname>.  
 | 
					   <productname>Postgres</productname>.  
 | 
				
			||||||
   <application>destroyuser</application> removes  users  and
 | 
					   <application>dropuser</application> removes  users  and
 | 
				
			||||||
   prevents them from accessing <productname>Postgres</productname>.
 | 
					   prevents them from accessing <productname>Postgres</productname>.
 | 
				
			||||||
  </para>
 | 
					  </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -115,7 +115,7 @@ Creating Postgres database system directory /home/postgres/data/base
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    <programlisting>
 | 
					    <programlisting>
 | 
				
			||||||
% createdb -D PGDATA2 test
 | 
					% createdb -D PGDATA2 test
 | 
				
			||||||
% destroydb test
 | 
					% dropdb test
 | 
				
			||||||
    </programlisting>
 | 
					    </programlisting>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   </para>
 | 
					   </para>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -305,7 +305,7 @@ mydb=> \q
 | 
				
			|||||||
     If you are the database administrator for the  database
 | 
					     If you are the database administrator for the  database
 | 
				
			||||||
     <Database>mydb</Database>,  you can destroy it using the following Unix command:
 | 
					     <Database>mydb</Database>,  you can destroy it using the following Unix command:
 | 
				
			||||||
<ProgramListing>
 | 
					<ProgramListing>
 | 
				
			||||||
% destroydb mydb
 | 
					% dropdb mydb
 | 
				
			||||||
</ProgramListing>
 | 
					</ProgramListing>
 | 
				
			||||||
     This action physically removes all of  the  Unix  files
 | 
					     This action physically removes all of  the  Unix  files
 | 
				
			||||||
     associated  with  the database and cannot be undone, so
 | 
					     associated  with  the database and cannot be undone, so
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/sh
 | 
				
			||||||
#-------------------------------------------------------------------------
 | 
					#-------------------------------------------------------------------------
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# createdb.sh--
 | 
					# createdb--
 | 
				
			||||||
#    create a postgres database
 | 
					#    create a postgres database
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#    This program runs psql with the "-c" option to create
 | 
					#    This program runs psql with the "-c" option to create
 | 
				
			||||||
@@ -11,7 +11,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IDENTIFICATION
 | 
					# IDENTIFICATION
 | 
				
			||||||
#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.1 1999/12/04 04:53:21 momjian Exp $
 | 
					#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.2 1999/12/07 22:41:44 momjian Exp $
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#-------------------------------------------------------------------------
 | 
					#-------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -21,6 +21,7 @@ MB=
 | 
				
			|||||||
PSQLOPT=
 | 
					PSQLOPT=
 | 
				
			||||||
dbname=
 | 
					dbname=
 | 
				
			||||||
dbcomment=
 | 
					dbcomment=
 | 
				
			||||||
 | 
					dbpath=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while [ $# -gt 0 ]
 | 
					while [ $# -gt 0 ]
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
@@ -33,12 +34,33 @@ do
 | 
				
			|||||||
	--host|-h)
 | 
						--host|-h)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -h $2"
 | 
							PSQLOPT="$PSQLOPT -h $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -h*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --host=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -h "`echo $1 | sed 's/^--host=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--port|-p)
 | 
						--port|-p)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -p $2"
 | 
							PSQLOPT="$PSQLOPT -p $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -p*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --port=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--user|--username|-U)
 | 
						--user|--username|-U)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -U $2"
 | 
							PSQLOPT="$PSQLOPT -U '$2'"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -U*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --user=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --username=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--password|-W)
 | 
						--password|-W)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -W"
 | 
							PSQLOPT="$PSQLOPT -W"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
@@ -49,18 +71,24 @@ do
 | 
				
			|||||||
		PSQLOPT="$PSQLOPT -o /dev/null"
 | 
							PSQLOPT="$PSQLOPT -o /dev/null"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
# options converted into SQL command
 | 
					# options converted into SQL command
 | 
				
			||||||
	--dbpath|-D)
 | 
						--location|-D)
 | 
				
			||||||
		dbpath="$2"
 | 
							dbpath="$2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -D*)
 | 
				
			||||||
 | 
					                dbpath=`echo $1 | sed 's/^-D//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --location=*)
 | 
				
			||||||
 | 
					                dbpath=`echo $1 | sed 's/^--location=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--encoding|-E)
 | 
						--encoding|-E)
 | 
				
			||||||
		MB=$2
 | 
							MB=$2
 | 
				
			||||||
		shift
 | 
							shift;;
 | 
				
			||||||
		if [ -z `pg_encoding $MB` ]; then
 | 
					        -E*)
 | 
				
			||||||
			echo "$CMDNAME: $MB is not a valid encoding name"
 | 
					                MB=`echo $1 | sed 's/^-E//'`
 | 
				
			||||||
			exit 1
 | 
					                ;;
 | 
				
			||||||
		fi
 | 
					        --encoding=*)
 | 
				
			||||||
		;;
 | 
					                MB=`echo $1 | sed 's/^--encoding=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	-*)
 | 
						-*)
 | 
				
			||||||
		echo "$CMDNAME: Unrecognized option: $1. Try -? for help."
 | 
							echo "$CMDNAME: Unrecognized option: $1. Try -? for help."
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
@@ -78,17 +106,26 @@ done
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$usage" ]; then
 | 
					if [ "$usage" ]; then
 | 
				
			||||||
	echo "Usage: $CMDNAME [-h <server>] [-p <port>] [-D <path>] \\"
 | 
						echo "Usage: $CMDNAME [-h server] [-p port] [-D path] \\"
 | 
				
			||||||
	echo "       [-E <encoding>] [-U <username>] [-W] dbname [description]"
 | 
						echo "       [-E encoding] [-U username] dbname [description]"
 | 
				
			||||||
	exit 0
 | 
						exit 0
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$MB" -a -z "`pg_encoding '$MB'`" ]; then
 | 
				
			||||||
 | 
						echo "$CMDNAME: \"$MB\" is not a valid encoding name."
 | 
				
			||||||
 | 
						exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -z "$dbname" ]; then
 | 
					if [ -z "$dbname" ]; then
 | 
				
			||||||
	echo "$CMDNAME: Missing required argument database name. Try -? for help."
 | 
						echo "$CMDNAME: Missing required argument database name. Try -? for help."
 | 
				
			||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dbpath=`echo $dbpath | sed "s/'/\\\\\'/g"`
 | 
				
			||||||
 | 
					dbname=`echo $dbname | sed 's/\"/\\\"/g'`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
withstring=
 | 
					withstring=
 | 
				
			||||||
[ "$dbpath" ] &&     withstring="$withstring LOCATION = '$dbpath'"
 | 
					[ "$dbpath" ] &&     withstring="$withstring LOCATION = '$dbpath'"
 | 
				
			||||||
[ "$MB" ] &&         withstring="$withstring ENCODING = '$MB'"
 | 
					[ "$MB" ] &&         withstring="$withstring ENCODING = '$MB'"
 | 
				
			||||||
@@ -103,10 +140,12 @@ fi
 | 
				
			|||||||
# Insert comment as well, if requested
 | 
					# Insert comment as well, if requested
 | 
				
			||||||
[ -z "$dbcomment" ] && exit 0
 | 
					[ -z "$dbcomment" ] && exit 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
psql $PSQLOPT -d template1 -c "COMMENT ON DATABASE \"$dbname\" IS \'$dbcomment\'"
 | 
					dbcomment=`echo $dbcomment | sed "s/'/\\\\\'/g"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					psql $PSQLOPT -d template1 -c "COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'"
 | 
				
			||||||
if [ $? -ne 0 ]; then
 | 
					if [ $? -ne 0 ]; then
 | 
				
			||||||
	echo "$CMDNAME: Comment creation failed."
 | 
						echo "$CMDNAME: Comment creation failed. (Database was created.)"
 | 
				
			||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exit 0
 | 
					exit 0
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IDENTIFICATION
 | 
					# IDENTIFICATION
 | 
				
			||||||
#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.1 1999/12/05 20:02:48 momjian Exp $
 | 
					#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.2 1999/12/07 22:41:44 momjian Exp $
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#-------------------------------------------------------------------------
 | 
					#-------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IDENTIFICATION
 | 
					# IDENTIFICATION
 | 
				
			||||||
#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.2 1999/12/05 20:52:54 momjian Exp $
 | 
					#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.3 1999/12/07 22:41:44 momjian Exp $
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Note - this should NOT be setuid.
 | 
					# Note - this should NOT be setuid.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -35,6 +35,7 @@ else
 | 
				
			|||||||
    ECHO_C='\c'
 | 
					    ECHO_C='\c'
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while [ $# -gt 0 ]
 | 
					while [ $# -gt 0 ]
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
    case "$1" in
 | 
					    case "$1" in
 | 
				
			||||||
@@ -46,17 +47,38 @@ do
 | 
				
			|||||||
	--host|-h)
 | 
						--host|-h)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -h $2"
 | 
							PSQLOPT="$PSQLOPT -h $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -h*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --host=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -h "`echo $1 | sed 's/^--host=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--port|-p)
 | 
						--port|-p)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -p $2"
 | 
							PSQLOPT="$PSQLOPT -p $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
# Uncomment these lines if you need the -U and -W options.
 | 
					        -p*)
 | 
				
			||||||
# They are confusing in this context, however.
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
#	--user|--username|-U)
 | 
					                ;;
 | 
				
			||||||
#		PSQLOPT="$PSQLOPT -U $2"
 | 
					        --port=*)
 | 
				
			||||||
#		shift;;
 | 
					                PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
 | 
				
			||||||
#	--password|-W)
 | 
					                ;;
 | 
				
			||||||
#		PSQLOPT="$PSQLOPT -W"
 | 
					# Note: These two specify the user to connect as (like in psql),
 | 
				
			||||||
#		;;
 | 
					#       not the user you're creating.
 | 
				
			||||||
 | 
						--user|--username|-U)
 | 
				
			||||||
 | 
							PSQLOPT="$PSQLOPT -U '$2'"
 | 
				
			||||||
 | 
							shift;;
 | 
				
			||||||
 | 
					        -U*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --user=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --username=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
						--password|-W)
 | 
				
			||||||
 | 
							PSQLOPT="$PSQLOPT -W"
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
	--echo|-e)
 | 
						--echo|-e)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -e"
 | 
							PSQLOPT="$PSQLOPT -e"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
@@ -76,6 +98,15 @@ do
 | 
				
			|||||||
        --no-adduser|-A)
 | 
					        --no-adduser|-A)
 | 
				
			||||||
		CanAddUser=f
 | 
							CanAddUser=f
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
 | 
					        --sysid|-i)
 | 
				
			||||||
 | 
					                SysID=$2
 | 
				
			||||||
 | 
					                shift;;
 | 
				
			||||||
 | 
					        --sysid=*)
 | 
				
			||||||
 | 
					                SysID=`echo $1 | sed 's/^--sysid=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        -i*)
 | 
				
			||||||
 | 
					                SysID=`echo $1 | sed 's/^-i//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--pwprompt|--pw|-P)
 | 
						--pwprompt|--pw|-P)
 | 
				
			||||||
		PwPrompt=t
 | 
							PwPrompt=t
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
@@ -94,11 +125,18 @@ done
 | 
				
			|||||||
# Help
 | 
					# Help
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$usage" ]; then
 | 
					if [ "$usage" ]; then
 | 
				
			||||||
	echo "Usage: $CMDNAME [-h <server>] [-p <port>] [-d|-D] [-a|-A] [-P] [username]"
 | 
						echo "Usage: $CMDNAME [-h server] [-p port] [-d|-D] [-a|-A] [-P] [-i id] [username]"
 | 
				
			||||||
	exit 0
 | 
						exit 0
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$SysID" ]; then
 | 
				
			||||||
 | 
					        if [ "$SysID" != "`echo $SysID | sed 's/[^0-9]//g'`" ]; then
 | 
				
			||||||
 | 
					                echo "$CMDNAME: User sysid must be a positive number."
 | 
				
			||||||
 | 
					                exit 1
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Get missing user attributes
 | 
					# Get missing user attributes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -z "$NewUser" ]; then
 | 
					if [ -z "$NewUser" ]; then
 | 
				
			||||||
@@ -108,12 +146,12 @@ if [ -z "$NewUser" ]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$PwPrompt" ]; then
 | 
					if [ "$PwPrompt" ]; then
 | 
				
			||||||
	$ECHO_N "Enter password for user $NewUser: "$ECHO_C
 | 
						$ECHO_N "Enter password for user \"$NewUser\": "$ECHO_C
 | 
				
			||||||
	read Password
 | 
						read Password
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -z "$CanCreateDb" ]; then
 | 
					if [ -z "$CanCreateDb" ]; then
 | 
				
			||||||
	$ECHO_N "Is the new user allowed to create databases? (y/n) "$ECHO_C
 | 
						$ECHO_N "Shall the new user be allowed to create databases? (y/n) "$ECHO_C
 | 
				
			||||||
	read REPLY
 | 
						read REPLY
 | 
				
			||||||
	[ $? -ne 0 ] && exit 1
 | 
						[ $? -ne 0 ] && exit 1
 | 
				
			||||||
	if [ $REPLY = "y" -o $REPLY = "Y" ]; then
 | 
						if [ $REPLY = "y" -o $REPLY = "Y" ]; then
 | 
				
			||||||
@@ -138,9 +176,16 @@ fi
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# build SQL command
 | 
					# build SQL command
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					NewUser=`echo $NewUser | sed 's/\"/\\\"/g'`
 | 
				
			||||||
 | 
					Password=`echo $Password | sed 's/\"/\\\"/g'`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QUERY="CREATE USER \"$NewUser\""
 | 
					QUERY="CREATE USER \"$NewUser\""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[ "$Password" ] &&        QUERY="$QUERY WITH PASSWORD \"$Password\""
 | 
					SUBQUERY=
 | 
				
			||||||
 | 
					[ "$SysID" ] &&    SUBQUERY="$SUBQUERY SYSID $SysID"
 | 
				
			||||||
 | 
					[ "$Password" ] && SUBQUERY="$SUBQUERY PASSWORD \"$Password\""
 | 
				
			||||||
 | 
					[ "$SUBQUERY" ] &&        QUERY="$QUERY WITH $SUBQUERY"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[ "$CanCreateDb" = t ] && QUERY="$QUERY CREATEDB"
 | 
					[ "$CanCreateDb" = t ] && QUERY="$QUERY CREATEDB"
 | 
				
			||||||
[ "$CanCreateDb" = f ] && QUERY="$QUERY NOCREATEDB"
 | 
					[ "$CanCreateDb" = f ] && QUERY="$QUERY NOCREATEDB"
 | 
				
			||||||
[ "$CanAddUser" = t ] &&  QUERY="$QUERY CREATEUSER"
 | 
					[ "$CanAddUser" = t ] &&  QUERY="$QUERY CREATEUSER"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IDENTIFICATION
 | 
					# IDENTIFICATION
 | 
				
			||||||
#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.2 1999/12/05 20:52:54 momjian Exp $
 | 
					#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.3 1999/12/07 22:41:44 momjian Exp $
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#-------------------------------------------------------------------------
 | 
					#-------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -31,6 +31,7 @@ else
 | 
				
			|||||||
    ECHO_C='\c'
 | 
					    ECHO_C='\c'
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while [ $# -gt 0 ]
 | 
					while [ $# -gt 0 ]
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
    case "$1" in 
 | 
					    case "$1" in 
 | 
				
			||||||
@@ -42,12 +43,33 @@ do
 | 
				
			|||||||
	--host|-h)
 | 
						--host|-h)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -h $2"
 | 
							PSQLOPT="$PSQLOPT -h $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -h*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --host=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -h "`echo $1 | sed 's/^--host=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--port|-p)
 | 
						--port|-p)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -p $2"
 | 
							PSQLOPT="$PSQLOPT -p $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -p*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --port=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--user|--username|-U)
 | 
						--user|--username|-U)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -U $2"
 | 
							PSQLOPT="$PSQLOPT -U '$2'"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -U*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --user=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --username=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--password|-W)
 | 
						--password|-W)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -W"
 | 
							PSQLOPT="$PSQLOPT -W"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
@@ -74,7 +96,7 @@ done
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$usage" ]; then
 | 
					if [ "$usage" ]; then
 | 
				
			||||||
	echo "Usage: $CMDNAME [-h <server>] [-p <port>] [-U <username>] [-W] [-i] dbname"
 | 
						echo "Usage: $CMDNAME [-h server] [-p port] [-U username] [-i] dbname"
 | 
				
			||||||
	exit 0
 | 
						exit 0
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -94,6 +116,8 @@ if [ "$forcedel" = f ]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dbname=`echo $dbname | sed 's/\"/\\\"/g'`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
 | 
					psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
 | 
				
			||||||
if [ $? -ne 0 ]; then
 | 
					if [ $? -ne 0 ]; then
 | 
				
			||||||
	echo "$CMDNAME: Database removal failed."
 | 
						echo "$CMDNAME: Database removal failed."
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IDENTIFICATION
 | 
					# IDENTIFICATION
 | 
				
			||||||
#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.2 1999/12/05 20:52:54 momjian Exp $
 | 
					#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.3 1999/12/07 22:41:44 momjian Exp $
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#-------------------------------------------------------------------------
 | 
					#-------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -20,6 +20,17 @@ langname=
 | 
				
			|||||||
echo=
 | 
					echo=
 | 
				
			||||||
list=
 | 
					list=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check for echo -n vs echo \c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if echo '\c' | grep -s c >/dev/null 2>&1
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					    ECHO_N="echo -n"
 | 
				
			||||||
 | 
					    ECHO_C=""
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    ECHO_N="echo"
 | 
				
			||||||
 | 
					    ECHO_C='\c'
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ----------
 | 
					# ----------
 | 
				
			||||||
# Get options, language name and dbname
 | 
					# Get options, language name and dbname
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,13 +2,13 @@
 | 
				
			|||||||
#-------------------------------------------------------------------------
 | 
					#-------------------------------------------------------------------------
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# dropuser--
 | 
					# dropuser--
 | 
				
			||||||
#    Utility for remocing a user from the PostgreSQL database.
 | 
					#    Utility for removing a user from the PostgreSQL database.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 1994, Regents of the University of California
 | 
					# Copyright (c) 1994, Regents of the University of California
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IDENTIFICATION
 | 
					# IDENTIFICATION
 | 
				
			||||||
#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.2 1999/12/05 20:52:54 momjian Exp $
 | 
					#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.3 1999/12/07 22:41:44 momjian Exp $
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Note - this should NOT be setuid.
 | 
					# Note - this should NOT be setuid.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
CMDNAME=`basename $0`
 | 
					CMDNAME=`basename $0`
 | 
				
			||||||
PSQLOPT=
 | 
					PSQLOPT=
 | 
				
			||||||
forcedel=t
 | 
					forcedel=t
 | 
				
			||||||
 | 
					DelUser=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Check for echo -n vs echo \c
 | 
					# Check for echo -n vs echo \c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -29,6 +30,7 @@ else
 | 
				
			|||||||
    ECHO_C='\c'
 | 
					    ECHO_C='\c'
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while [ $# -gt 0 ]
 | 
					while [ $# -gt 0 ]
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
    case "$1" in
 | 
					    case "$1" in
 | 
				
			||||||
@@ -40,17 +42,38 @@ do
 | 
				
			|||||||
	--host|-h)
 | 
						--host|-h)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -h $2"
 | 
							PSQLOPT="$PSQLOPT -h $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -h*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --host=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -h "`echo $1 | sed 's/^--host=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--port|-p)
 | 
						--port|-p)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -p $2"
 | 
							PSQLOPT="$PSQLOPT -p $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
# Uncomment these lines if you need the -U and -W options.
 | 
					        -p*)
 | 
				
			||||||
# They are confusing in this context, however.
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
#	--user|--username|-U)
 | 
					                ;;
 | 
				
			||||||
#		PSQLOPT="$PSQLOPT -U $2"
 | 
					        --port=*)
 | 
				
			||||||
#		shift;;
 | 
					                PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
 | 
				
			||||||
#	--password|-W)
 | 
					                ;;
 | 
				
			||||||
#		PSQLOPT="$PSQLOPT -W"
 | 
					# Note: These two specify the user to connect as (like in psql),
 | 
				
			||||||
#		;;
 | 
					#       not the user you're dropping.
 | 
				
			||||||
 | 
						--user|--username|-U)
 | 
				
			||||||
 | 
							PSQLOPT="$PSQLOPT -U '$2'"
 | 
				
			||||||
 | 
							shift;;
 | 
				
			||||||
 | 
					        -U*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --user=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --username=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
						--password|-W)
 | 
				
			||||||
 | 
							PSQLOPT="$PSQLOPT -W"
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
	--echo|-e)
 | 
						--echo|-e)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -e"
 | 
							PSQLOPT="$PSQLOPT -e"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
@@ -76,7 +99,7 @@ done
 | 
				
			|||||||
# Help
 | 
					# Help
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$usage" ]; then
 | 
					if [ "$usage" ]; then
 | 
				
			||||||
	echo "Usage: $CMDNAME [-h <server>] [-p <port>] [-i] [username]"
 | 
						echo "Usage: $CMDNAME [-h server] [-p port] [-i] [username]"
 | 
				
			||||||
	exit 0
 | 
						exit 0
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -84,7 +107,7 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if [ -z "$DelUser" ]; then
 | 
					if [ -z "$DelUser" ]; then
 | 
				
			||||||
	$ECHO_N "Enter name of user to delete: "$ECHO_C
 | 
						$ECHO_N "Enter name of user to delete: "$ECHO_C
 | 
				
			||||||
	read NewUser
 | 
						read DelUser
 | 
				
			||||||
	[ $? -ne 0 ] && exit 1
 | 
						[ $? -ne 0 ] && exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -99,6 +122,8 @@ if [ "$forcedel" = f ]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DelUser=`echo $DelUser | sed 's/\"/\\\"/g'`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
psql $PSQLOPT -d template1 -c "DROP USER \"$DelUser\""
 | 
					psql $PSQLOPT -d template1 -c "DROP USER \"$DelUser\""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ $? -ne 0 ]; then
 | 
					if [ $? -ne 0 ]; then
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IDENTIFICATION
 | 
					# IDENTIFICATION
 | 
				
			||||||
#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.2 1999/12/05 20:02:49 momjian Exp $
 | 
					#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.3 1999/12/07 22:41:44 momjian Exp $
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#-------------------------------------------------------------------------
 | 
					#-------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -21,6 +21,7 @@ PSQLOPT=
 | 
				
			|||||||
verbose=
 | 
					verbose=
 | 
				
			||||||
analyze=
 | 
					analyze=
 | 
				
			||||||
table=
 | 
					table=
 | 
				
			||||||
 | 
					dbname=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while [ $# -gt 0 ]
 | 
					while [ $# -gt 0 ]
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
@@ -33,12 +34,33 @@ do
 | 
				
			|||||||
	--host|-h)
 | 
						--host|-h)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -h $2"
 | 
							PSQLOPT="$PSQLOPT -h $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -h*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --host=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -h "`echo $1 | sed 's/^--host=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--port|-p)
 | 
						--port|-p)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -p $2"
 | 
							PSQLOPT="$PSQLOPT -p $2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -p*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --port=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--user|--username|-U)
 | 
						--user|--username|-U)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -U $2"
 | 
							PSQLOPT="$PSQLOPT -U '$2'"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -U*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT $1"
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --user=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --username=*)
 | 
				
			||||||
 | 
					                PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--password|-W)
 | 
						--password|-W)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -W"
 | 
							PSQLOPT="$PSQLOPT -W"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
@@ -48,6 +70,9 @@ do
 | 
				
			|||||||
	--quiet|-q)
 | 
						--quiet|-q)
 | 
				
			||||||
		PSQLOPT="$PSQLOPT -o /dev/null"
 | 
							PSQLOPT="$PSQLOPT -o /dev/null"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
 | 
						--dbname|--database|-d)
 | 
				
			||||||
 | 
							dbname="$2"
 | 
				
			||||||
 | 
							shift;;
 | 
				
			||||||
        -d*)
 | 
					        -d*)
 | 
				
			||||||
                dbname=`echo $1 | sed 's/^-d//'`
 | 
					                dbname=`echo $1 | sed 's/^-d//'`
 | 
				
			||||||
                ;;
 | 
					                ;;
 | 
				
			||||||
@@ -59,21 +84,26 @@ do
 | 
				
			|||||||
                ;;
 | 
					                ;;
 | 
				
			||||||
# options converted into SQL command
 | 
					# options converted into SQL command
 | 
				
			||||||
	--analyze|-z)
 | 
						--analyze|-z)
 | 
				
			||||||
		analyze="analyze"
 | 
							analyze="ANALYZE "
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
	--table|-t)
 | 
						--table|-t)
 | 
				
			||||||
		table=$2
 | 
							table="$2"
 | 
				
			||||||
		shift;;
 | 
							shift;;
 | 
				
			||||||
 | 
					        -t*)
 | 
				
			||||||
 | 
					                table=`echo $1 | sed 's/^-t//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					        --table=*)
 | 
				
			||||||
 | 
					                table=`echo $1 | sed 's/^--table=//'`
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
	--verbose|-v)
 | 
						--verbose|-v)
 | 
				
			||||||
		verbose="verbose"
 | 
							verbose="VERBOSE "
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	-*)
 | 
						-*)
 | 
				
			||||||
		echo "$CMDNAME: Unrecognized option: $1. Try -? for help."
 | 
							echo "$CMDNAME: Unrecognized option: $1. Try -? for help."
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
 | 
						*)
 | 
				
			||||||
	 *)
 | 
					 | 
				
			||||||
		dbname="$1"
 | 
							dbname="$1"
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
    esac
 | 
					    esac
 | 
				
			||||||
@@ -82,7 +112,7 @@ done
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$usage" ]; then
 | 
					if [ "$usage" ]; then
 | 
				
			||||||
	echo "Usage: $CMDNAME [-h <server>] [-p <port>] [-U <username>] [-W] [-d <dbname>] \\"
 | 
						echo "Usage: $CMDNAME [-h server] [-p port] [-U username] [-d dbname] \\"
 | 
				
			||||||
	echo "       [-z|--analyze] [-v|--verbose] [-t|--table 'table[(columns)]'] [dbname]"
 | 
						echo "       [-z|--analyze] [-v|--verbose] [-t|--table 'table[(columns)]'] [dbname]"
 | 
				
			||||||
	exit 0
 | 
						exit 0
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
@@ -92,10 +122,10 @@ if [ -z "$dbname" ]; then
 | 
				
			|||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
psql $PSQLOPT -d "$dbname" -c "VACUUM $verbose $analyze $table"
 | 
					psql $PSQLOPT -d "$dbname" -c "VACUUM $verbose$analyze$table"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ $? -ne 0 ]; then
 | 
					if [ $? -ne 0 ]; then
 | 
				
			||||||
	echo "$CMDNAME: Database vacuum failed."
 | 
						echo "$CMDNAME: Vacuum failed."
 | 
				
			||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user