Database Reference
In-Depth Information
cat: /opt/PostgreSQL/9.4/data/bar.txt: No such file or
directory
•
pg_file_length
: The
pg_file_lenght
function is used to get the length of
ile. This can be explained using the following example, in which we need
to recreate the ile as we just removed before using the
pg_file_length
function:
warehouse_db=# SELECT pg_file_write('foo.txt', 'Hello
World', false);
pg_file_write
---------------
11
(1 row)
warehouse_db=# SELECT pg_file_length('foo.txt');
pg_file_length
----------------
11
(1 row)
•
pg_logdir_ls
: The
pg_logdir_ls
function lists all iles in a
log
directory
•
pg_file_read
: The user can read the data from the ile by making use of the
pg_file_read
function
•
pg_logfile_rotate
: The user can rotate a log ile using the
pg_logfile_
rotate
function
The chkpass extension
This extension provides a new data type
chkpass
, which can be used to store
encrypted data. Most of the time, we need to store the data in a database that cannot be
read or stored or encrypted like passwords. Any values encrypted before saving into a
column shows that the data type is
chkpass
and cannot be read in clear text. Its value
can only be compared with string literals or non-encrypted values of the columns.
Creating the
CHKPASS
extension using the following statement:
warehouse_db=# CREATE EXTENSION CHKPASS;
Creating the
foo
table using the following statement:
warehouse_db=# CREATE TABLE foo (id INTEGER, username TEXT,
password CHKPASS);