Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
008e9e45
Commit
008e9e45
authored
Dec 27, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More minor updates and copy-editing.
parent
361f3541
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
445 additions
and
388 deletions
+445
-388
doc/src/sgml/charset.sgml
doc/src/sgml/charset.sgml
+376
-350
doc/src/sgml/maintenance.sgml
doc/src/sgml/maintenance.sgml
+38
-10
doc/src/sgml/manage-ag.sgml
doc/src/sgml/manage-ag.sgml
+15
-16
doc/src/sgml/user-manag.sgml
doc/src/sgml/user-manag.sgml
+16
-12
No files found.
doc/src/sgml/charset.sgml
View file @
008e9e45
This diff is collapsed.
Click to expand it.
doc/src/sgml/maintenance.sgml
View file @
008e9e45
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.
39 2004/12/13 18:05:08 petere
Exp $
$PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.
40 2004/12/27 22:30:10 tgl
Exp $
-->
-->
<chapter id="maintenance">
<chapter id="maintenance">
...
@@ -79,7 +79,7 @@ $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.39 2004/12/13 18:05:08 pete
...
@@ -79,7 +79,7 @@ $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.39 2004/12/13 18:05:08 pete
Therefore, database administrators must understand these issues and
Therefore, database administrators must understand these issues and
develop an appropriate maintenance strategy. This section concentrates
develop an appropriate maintenance strategy. This section concentrates
on explaining the high-level issues; for details about command syntax
on explaining the high-level issues; for details about command syntax
and so on, see the <
command>VACUUM</> command
reference page.
and so on, see the <
xref linkend="sql-vacuum">
reference page.
</para>
</para>
<para>
<para>
...
@@ -91,6 +91,13 @@ $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.39 2004/12/13 18:05:08 pete
...
@@ -91,6 +91,13 @@ $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.39 2004/12/13 18:05:08 pete
times of day.
times of day.
</para>
</para>
<para>
Beginning in <productname>PostgreSQL</productname> 8.0, there are
configuration parameters that can be adjusted to further reduce the
performance impact of background vacuuming. See
<xref linkend="runtime-config-resource-vacuum-cost">.
</para>
<sect2 id="vacuum-for-space-recovery">
<sect2 id="vacuum-for-space-recovery">
<title>Recovering disk space</title>
<title>Recovering disk space</title>
...
@@ -162,13 +169,20 @@ $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.39 2004/12/13 18:05:08 pete
...
@@ -162,13 +169,20 @@ $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.39 2004/12/13 18:05:08 pete
Recommended practice for most sites is to schedule a database-wide
Recommended practice for most sites is to schedule a database-wide
<command>VACUUM</> once a day at a low-usage time of day,
<command>VACUUM</> once a day at a low-usage time of day,
supplemented by more frequent vacuuming of heavily-updated tables
supplemented by more frequent vacuuming of heavily-updated tables
if necessary.
In fact, s
ome installations with an extremely high
if necessary.
(S
ome installations with an extremely high
rate of data modification <command>VACUUM</command>
some
tables as
rate of data modification <command>VACUUM</command>
busy
tables as
often as once
very five minutes. (
If you have multiple databases
often as once
every few minutes.)
If you have multiple databases
in a cluster, don't forget to <command>VACUUM</command> each one;
in a cluster, don't forget to <command>VACUUM</command> each one;
the program <filename>vacuumdb</> may be helpful.
)
the program <filename>vacuumdb</> may be helpful.
</para>
</para>
<tip>
<para>
The <filename>contrib/pg_autovacuum</> program can be useful for
automating high-frequency vacuuming operations.
</para>
</tip>
<para>
<para>
<command>VACUUM FULL</> is recommended for cases where you know
<command>VACUUM FULL</> is recommended for cases where you know
you have deleted the majority of rows in a table, so that the
you have deleted the majority of rows in a table, so that the
...
@@ -404,6 +418,18 @@ VACUUM
...
@@ -404,6 +418,18 @@ VACUUM
you to ensure that such databases are frozen correctly.
you to ensure that such databases are frozen correctly.
</para>
</para>
<warning>
<para>
To be sure of safety against transaction wraparound, it is necessary
to vacuum <emphasis>every</> table, including system catalogs, in
<emphasis>every</> database at least once every billion transactions.
We have seen data loss situations caused by people deciding that they
only needed to vacuum their active user tables, rather than issuing
database-wide vacuum commands. That will appear to work fine ...
for a while.
</para>
</warning>
</sect2>
</sect2>
</sect1>
</sect1>
...
@@ -475,7 +501,7 @@ VACUUM
...
@@ -475,7 +501,7 @@ VACUUM
If you start the server with
If you start the server with
<command>pg_ctl</>, then <systemitem>stderr</>
<command>pg_ctl</>, then <systemitem>stderr</>
is already redirected to <systemitem>stdout</>, so you just need a
is already redirected to <systemitem>stdout</>, so you just need a
pipe command:
pipe command
, for example
:
<programlisting>
<programlisting>
pg_ctl start | rotatelogs /var/log/pgsql_log 86400
pg_ctl start | rotatelogs /var/log/pgsql_log 86400
...
@@ -499,7 +525,7 @@ pg_ctl start | rotatelogs /var/log/pgsql_log 86400
...
@@ -499,7 +525,7 @@ pg_ctl start | rotatelogs /var/log/pgsql_log 86400
<para>
<para>
On many systems, however, <application>syslog</> is not very reliable,
On many systems, however, <application>syslog</> is not very reliable,
particularly with large log messages; it may truncate or drop messages
particularly with large log messages; it may truncate or drop messages
just when you need them the most. Also, on <productname>
l
inux</>,
just when you need them the most. Also, on <productname>
L
inux</>,
<application>syslog</> will sync each message to disk, yielding poor
<application>syslog</> will sync each message to disk, yielding poor
performance. (You can use a <literal>-</> at the start of the file name
performance. (You can use a <literal>-</> at the start of the file name
in the <application>syslog</> configuration file to disable this behavior.)
in the <application>syslog</> configuration file to disable this behavior.)
...
@@ -508,8 +534,10 @@ pg_ctl start | rotatelogs /var/log/pgsql_log 86400
...
@@ -508,8 +534,10 @@ pg_ctl start | rotatelogs /var/log/pgsql_log 86400
<para>
<para>
Note that all the solutions described above take care of starting new
Note that all the solutions described above take care of starting new
log files at configurable intervals, but they do not handle deletion
log files at configurable intervals, but they do not handle deletion
of old, no-longer-interesting log files. You will also want to set
of old, no-longer-interesting log files. You will probably want to set
up a batch job to periodically delete old log files.
up a batch job to periodically delete old log files. Another possibility
is to configure the rotation program so that old log files are overwritten
cyclically.
</para>
</para>
</sect1>
</sect1>
</chapter>
</chapter>
...
...
doc/src/sgml/manage-ag.sgml
View file @
008e9e45
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.3
8 2004/12/13 18:05:08 petere
Exp $
$PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.3
9 2004/12/27 22:30:10 tgl
Exp $
-->
-->
<chapter id="managing-databases">
<chapter id="managing-databases">
...
@@ -37,23 +37,21 @@ $PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.38 2004/12/13 18:05:08 petere
...
@@ -37,23 +37,21 @@ $PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.38 2004/12/13 18:05:08 petere
</para>
</para>
<para>
<para>
An application that connects to the database server specifies
in
When connecting to the database server, a client must specify
in
its connection request the name of the database it wants to connect
its connection request the name of the database it wants to connect
to. It is not possible to access more than one database per
to. It is not possible to access more than one database per
connection. (But an application is not restricted in the number of
connection. (But an application is not restricted in the number of
connections it opens to the same or other databases.) It is
connections it opens to the same or other databases.) Databases are
possible, however, to access more than one schema from the same
connection. Schemas are a purely logical structure and who can
access what is managed by the privilege system. Databases are
physically separated and access control is managed at the
physically separated and access control is managed at the
connection level. If one <productname>PostgreSQL</> server
connection level. If one <productname>PostgreSQL</> server
instance is to house projects or users that should be separate and
instance is to house projects or users that should be separate and
for the most part unaware of each other, it is therefore
for the most part unaware of each other, it is therefore
recommendable to put them into separate databases. If the projects
recommendable to put them into separate databases. If the projects
or users are interrelated and should be able to use each other's
or users are interrelated and should be able to use each other's
resources they should be put in the same databases but possibly
resources they should be put in the same database, but possibly
into separate schemas. More information about managing schemas is
into separate schemas. Schemas are a purely logical structure and who can
in <xref linkend="ddl-schemas">.
access what is managed by the privilege system. More information about
managing schemas is in <xref linkend="ddl-schemas">.
</para>
</para>
<note>
<note>
...
@@ -116,7 +114,7 @@ CREATE DATABASE <replaceable>name</>;
...
@@ -116,7 +114,7 @@ CREATE DATABASE <replaceable>name</>;
</para>
</para>
<para>
<para>
As a
n extra convenience, there is also
a program that you can
As a
convenience, there is
a program that you can
execute from the shell to create new databases,
execute from the shell to create new databases,
<command>createdb</>.<indexterm><primary>createdb</></>
<command>createdb</>.<indexterm><primary>createdb</></>
...
@@ -127,7 +125,7 @@ createdb <replaceable class="parameter">dbname</replaceable>
...
@@ -127,7 +125,7 @@ createdb <replaceable class="parameter">dbname</replaceable>
<command>createdb</> does no magic. It connects to the <literal>template1</>
<command>createdb</> does no magic. It connects to the <literal>template1</>
database and issues the <command>CREATE DATABASE</> command,
database and issues the <command>CREATE DATABASE</> command,
exactly as described above.
exactly as described above.
The
reference page on <command>createdb</>
contains the invocation
The
<xref linkend="app-createdb"> reference page
contains the invocation
details. Note that <command>createdb</> without any arguments will create
details. Note that <command>createdb</> without any arguments will create
a database with the current user name, which may or may not be what
a database with the current user name, which may or may not be what
you want.
you want.
...
@@ -285,10 +283,11 @@ createdb -T template0 <replaceable>dbname</>
...
@@ -285,10 +283,11 @@ createdb -T template0 <replaceable>dbname</>
<programlisting>
<programlisting>
ALTER DATABASE mydb SET geqo TO off;
ALTER DATABASE mydb SET geqo TO off;
</programlisting>
</programlisting>
This will save the setting (but not set it immediately) and in
This will save the setting (but not set it immediately). In
subsequent connections it will appear as though <literal>SET geqo
subsequent connections to this database it will appear as though
TO off;</literal> had been called right before the session started.
<literal>SET geqo TO off;</literal> had been executed just before the
Note that users can still alter this setting during the session; it
session started.
Note that users can still alter this setting during their sessions; it
will only be the default. To undo any such setting, use
will only be the default. To undo any such setting, use
<literal>ALTER DATABASE <replaceable>dbname</> RESET
<literal>ALTER DATABASE <replaceable>dbname</> RESET
<replaceable>varname</>;</literal>.
<replaceable>varname</>;</literal>.
...
@@ -322,7 +321,7 @@ DROP DATABASE <replaceable>name</>;
...
@@ -322,7 +321,7 @@ DROP DATABASE <replaceable>name</>;
<para>
<para>
For convenience, there is also a shell program to drop
For convenience, there is also a shell program to drop
databases:<indexterm><primary>dropdb</></>
databases
, <xref linkend="app-dropdb">
:<indexterm><primary>dropdb</></>
<synopsis>
<synopsis>
dropdb <replaceable class="parameter">dbname</replaceable>
dropdb <replaceable class="parameter">dbname</replaceable>
</synopsis>
</synopsis>
...
...
doc/src/sgml/user-manag.sgml
View file @
008e9e45
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.2
5 2004/02/17 09:07:16 neilc
Exp $
$PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.2
6 2004/12/27 22:30:10 tgl
Exp $
-->
-->
<chapter id="user-manag">
<chapter id="user-manag">
...
@@ -175,9 +175,10 @@ dropuser <replaceable>name</replaceable>
...
@@ -175,9 +175,10 @@ dropuser <replaceable>name</replaceable>
<programlisting>
<programlisting>
ALTER USER myname SET enable_indexscan TO off;
ALTER USER myname SET enable_indexscan TO off;
</programlisting>
</programlisting>
This will save the setting (but not set it immediately) and in
This will save the setting (but not set it immediately). In
subsequent connections it will appear as though <literal>SET enable_indexscan
subsequent connections by this user it will appear as though
TO off;</literal> had been called right before the session started.
<literal>SET enable_indexscan TO off;</literal> had been executed
just before the session started.
You can still alter this setting during the session; it will only
You can still alter this setting during the session; it will only
be the default. To undo any such setting, use <literal>ALTER USER
be the default. To undo any such setting, use <literal>ALTER USER
<replaceable>username</> RESET <replaceable>varname</>;</literal>.
<replaceable>username</> RESET <replaceable>varname</>;</literal>.
...
@@ -243,7 +244,7 @@ ALTER GROUP <replaceable>name</replaceable> DROP USER <replaceable>uname1</repla
...
@@ -243,7 +244,7 @@ ALTER GROUP <replaceable>name</replaceable> DROP USER <replaceable>uname1</repla
<literal>RULE</>, <literal>REFERENCES</>, <literal>TRIGGER</>,
<literal>RULE</>, <literal>REFERENCES</>, <literal>TRIGGER</>,
<literal>CREATE</>, <literal>TEMPORARY</>, <literal>EXECUTE</>,
<literal>CREATE</>, <literal>TEMPORARY</>, <literal>EXECUTE</>,
<literal>USAGE</>, and <literal>ALL PRIVILEGES</>. For more
<literal>USAGE</>, and <literal>ALL PRIVILEGES</>. For more
information on the different types of privileges support by
information on the different types of privileges support
ed
by
<productname>PostgreSQL</productname>, see the
<productname>PostgreSQL</productname>, see the
<xref linkend="sql-grant" endterm="sql-grant-title"> reference page.
<xref linkend="sql-grant" endterm="sql-grant-title"> reference page.
The right to modify or
The right to modify or
...
@@ -289,18 +290,21 @@ REVOKE ALL ON accounts FROM PUBLIC;
...
@@ -289,18 +290,21 @@ REVOKE ALL ON accounts FROM PUBLIC;
Functions and triggers allow users to insert code into the backend
Functions and triggers allow users to insert code into the backend
server that other users may execute without knowing it. Hence, both
server that other users may execute without knowing it. Hence, both
mechanisms permit users to <quote>Trojan horse</quote>
mechanisms permit users to <quote>Trojan horse</quote>
others with relative
impunity
. The only real protection is tight
others with relative
ease
. The only real protection is tight
control over who can define functions.
control over who can define functions.
</para>
</para>
<para>
<para>
Functions written in any language except SQL run inside the backend
Functions run inside the backend
server process with the operating systems permissions of the
server process with the operating system permissions of the
database server daemon process. It is possible to change the
database server daemon. If the programmming language
server's internal data structures from inside of trusted functions.
used for the function allows unchecked memory accesses, it is
possible to change the server's internal data structures.
Hence, among many other things, such functions can circumvent any
Hence, among many other things, such functions can circumvent any
system access controls. This is an inherent problem with
system access controls. Function languages that allow such access
user-defined C functions.
are considered <quote>untrusted</>, and
<productname>PostgreSQL</productname> allows only superusers to
create functions written in those languages.
</para>
</para>
</sect1>
</sect1>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment