Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
f2764eea
Commit
f2764eea
authored
27 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Clarify ownership and security issues with alternate db locations.
parent
3d96825b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/ref/create_database.sgml
+17
-23
17 additions, 23 deletions
doc/src/sgml/ref/create_database.sgml
with
17 additions
and
23 deletions
doc/src/sgml/ref/create_database.sgml
+
17
−
23
View file @
f2764eea
...
@@ -130,7 +130,7 @@ There was a problem with creating the required directory; this operation will
...
@@ -130,7 +130,7 @@ There was a problem with creating the required directory; this operation will
Description
Description
</TITLE>
</TITLE>
<PARA>
<PARA>
CREATE DATABASE creates a new Postgre
SQL
database.
<command>
CREATE DATABASE
</command>
creates a new Postgre
s
database.
The creator becomes the administrator of the new database.
The creator becomes the administrator of the new database.
</PARA>
</PARA>
...
@@ -142,10 +142,10 @@ There was a problem with creating the required directory; this operation will
...
@@ -142,10 +142,10 @@ There was a problem with creating the required directory; this operation will
Notes
Notes
</TITLE>
</TITLE>
<PARA>
<PARA>
CREATE DATABASE statement is a Postgre
SQL
language extension.
<command>
CREATE DATABASE
</command>
statement is a Postgre
s
language extension.
</PARA>
</PARA>
<para>
<para>
Refer to DROP DATABASE statement to remove a database.
Refer to
<command>
DROP DATABASE
</command>
statement to remove a database.
</para>
</para>
</REFSECT2>
</REFSECT2>
...
@@ -157,19 +157,17 @@ There was a problem with creating the required directory; this operation will
...
@@ -157,19 +157,17 @@ There was a problem with creating the required directory; this operation will
To create a new database:
To create a new database:
</PARA>
</PARA>
<ProgramListing>
<ProgramListing>
CREATE DATABASE lusiadas;
<prompt>olly=></prompt></computeroutput> <userinput>create database lusiadas;</userinput>
</ProgramListing>
</ProgramListing>
<PARA>
<PARA>
To create a new database in <filename>~/private_db</filename>:
To create a new database in
an alternate area
<filename>~/private_db</filename>:
</PARA>
</PARA>
<ProgramListing>
<ProgramListing>
$
mkdir private_db
<prompt>$</prompt> <userinput>
mkdir private_db
</userinput>
$
initlocation ~/private_db
<prompt>$</prompt> <userinput>
initlocation ~/private_db
</userinput>
<computeroutput>Creating Postgres database system directory /home/olly/private_db/base</computeroutput>
<computeroutput>Creating Postgres database system directory /home/olly/private_db/base</computeroutput>
$ chmod a+rx private_db
<prompt>$</prompt> <userinput>psql olly</userinput>
$ chmod a+rwx private_db/base
$ psql
<computeroutput>Welcome to the POSTGRESQL interactive sql monitor:
<computeroutput>Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
...
@@ -178,7 +176,7 @@ There was a problem with creating the required directory; this operation will
...
@@ -178,7 +176,7 @@ There was a problem with creating the required directory; this operation will
type \g or terminate with semicolon to execute query
type \g or terminate with semicolon to execute query
You are currently connected to the database: template1
You are currently connected to the database: template1
template1=
></computeroutput> <userinput>create database elsewhere with location = '/home/olly/private_db';</userinput>
<prompt>olly=></prompt
></computeroutput> <userinput>create database elsewhere with location = '/home/olly/private_db';</userinput>
<computeroutput>CREATEDB</computeroutput>
<computeroutput>CREATEDB</computeroutput>
</ProgramListing>
</ProgramListing>
</REFSECT1>
</REFSECT1>
...
@@ -188,23 +186,19 @@ There was a problem with creating the required directory; this operation will
...
@@ -188,23 +186,19 @@ There was a problem with creating the required directory; this operation will
Bugs
Bugs
</TITLE>
</TITLE>
<PARA>
<PARA>
Where an ordinary user cannot change the ownership of files to other users
There are security and data integrity issues involved with using alternate database locations
(which is correct from a security point of view), there is no easy way
specified with absolute path names. See the Administrator's Guide for more information.
to give the postgres backend access to files in a database at a
non-standard location without
giving similar access to all users. The situation shown in the usage
example makes <filename>/home/olly/private_db</filename> world-accessible.
</PARA>
</PARA>
<para>
<!-- ------------------
If, on the other hand, the user gets the system administrator to give
comment from Olly; response from Thomas...
file ownership to the <literal>postgres</literal> superuser and restrict access, he will
then be unable to delete the <filename><replaceable>directory</replaceable>/base</filename> directory.
</para>
<comment>
<comment>
initlocation does not create a PG_VERSION file in the specified location.
initlocation does not create a PG_VERSION file in the specified location.
How will Postgre
SQL
handle the situation if it is upgraded to an
How will Postgre
s
handle the situation if it is upgraded to an
incompatible database version?
incompatible database version?
</comment>
</comment>
Hmm. This isn't an issue since the upgrade would do a dump/reload from the main database area also.
Not sure if the dump/reload would guarantee that the alternate data area gets refreshed though...
-------------------- -->
</refsect1>
</refsect1>
<REFSECT1 ID="R1-SQL-CREATEDATABASE-4">
<REFSECT1 ID="R1-SQL-CREATEDATABASE-4">
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment