AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Configure postgresql data directory1/25/2024 ![]() The first group ( rwx in this example) specifies access permissions for the owner of the file. The first character is a file type indicator and contains a " d" for directories and a " -" for normal files (other values are possible?refer to your OS documentation for more information).įollowing the type indicator are three groups of access permissions, and each group contains three characters. The file permissions column can be interpreted as follows: Working to the left, you'll see the modification date, file size (in bytes), group name, username, link count, and file permissions. Starting at the right-most column, you see the file (or directory) name. rw- 1 postgres postgresgrp 47 Jan 10 14:18Įach line of output can be divided into seven columns. rw- 1 postgres postgresgrp 49 Jan 10 14:18 rw- 1 postgres postgresgrp 3137 Oct 22 17:35 rw- 1 postgres postgresgrp 4 Oct 22 17:35ĭrwx- 2 postgres postgresgrp 4096 Oct 22 17:35 pg_xlog rw- 1 postgres postgresgrp 1118 Oct 22 17:35 pg_ident. rw- 1 postgres postgresgrp 7482 Jan 15 19:26 pg_hba. Here is an example:ĭrwx- 5 postgres postgresgrp 4096 Oct 22 17:40 baseĭrwx- 2 postgres postgresgrp 4096 Jan 15 18:58 global You can see all three of these attributes using the ls ?l command. Each file (or directory) has an owner, a group, and a set of permissions. In a Unix environment, there are three aspects to file system security. The data/pg_xlog directory contains the write-ahead transaction log (also described in Chapter 19). OID to Table Mapping in the global DirectoryĮach of these files is explained in Chapter 19, "General PostgreSQL Administration," so I won't cover that information here. Table 21.1 shows how the OID values translate into table names. ![]() Like the data/base directory, the data/global directory contains a few files whose names are actually OID values. The data/global directory contains information that spans all databases in other words, the information in the global directory is independent of any particular database. Psql> select oid, datname from pg_database You can see the correspondence by executing the following query: If you are curious about the directory naming scheme, the numbers correspond to the OIDs (object ids) of the corresponding rows in the pg_database table. Notice that I have three subdirectories underneath the base directory?that's because I have three databases. The data/base directory is where your databases live. This snapshot shows a typical installation of PostgreSQL release 7.1.3. You may see more files and subdirectories if you are running a different version of PostgreSQL. The data directory contains three subdirectories: base, global, and pg_xlog. The directory structure of a PostgreSQL installation. Figure 21.1 gives you a look at the structure. Let's start by looking at the directory structure of a PostgreSQL installation. PostgreSQL uses the $PGDATA environment variable to find its data files. I'll refer to this last directory as $PGDATA. ![]() If you have a typical installation, you can expect to find data files: databases, configuration, and security information in / usr/local/pgsql/data. Executables (such as psql, initdb, and the postmaster) are often installed in the /usr/local/pgsql/bin directory. PostgreSQL is typically installed in the /usr/local/pgsql directory. The first step in securing a PostgreSQL installation is to secure the actual data files that comprise each database.
0 Comments
Read More
Leave a Reply. |