Top
Enterprise Postgres 18 for Kubernetes User's Guide

5.12.3 Encrypting a Tablespace

If you create an encrypted tablespace, configure the encryption algorithm in runtime parameters. For example, to create a tablespace named secure_tablespace using AES with a 256-bit key length as the encryption algorithm, define:

-- Specify the encryption algorithm for the tablespace to be created below
SET tablespace_encryption_algorithm = 'AES256';
CREATE TABLESPACE secure_tablespace LOCATION /database/tablespaces/tbspace1;

-- Specify that the tablespace to be created below is not to be encrypted SET tablespace_encryption_algorithm = 'none';

Or

CREATE TABLESPACE tbs_tst_new LOCATION '/database/tablespaces/tbspace1' WITH (tablespace_encryption_algorithm = 'AES256' );

Checking for encrypted tablespaces

You can check which tablespaces are encrypted by executing the following SQL.

SELECT spcname, spcencalgo FROM pg_tablespace ts, pgx_tablespaces tsx WHERE ts.oid = tsx.spctablespace;