mirror of https://github.com/postgres/postgres
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
![]()
4 months ago
|
# Use External Reference to Parameters
|
||
![]()
1 year ago
|
|
||
|
To allow storing secrets or any other parameters in a more secure, external location, `pg_tde`
|
||
|
allows users to specify an external reference instead of hardcoded parameters.
|
||
|
|
||
![]()
4 months ago
|
In the Alpha1 version, `pg_tde` supports the following external storage methods:
|
||
![]()
1 year ago
|
|
||
|
* `file`, which just stores the data in a simple file specified by a `path`. The file should be
|
||
|
readable to the postgres process.
|
||
|
* `remote`, which uses a HTTP request to retrieve the parameter from the specified `url`.
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
To use the file provider with a file location specified by the `remote` method,
|
||
|
use the following command:
|
||
|
|
||
![]()
4 months ago
|
```sql
|
||
![]()
5 months ago
|
SELECT pg_tde_add_database_key_provider_file(
|
||
![]()
1 year ago
|
'file-provider',
|
||
|
json_object( 'type' VALUE 'remote', 'url' VALUE 'http://localhost:8888/hello' )
|
||
|
);"
|
||
|
```
|
||
|
|
||
|
Or to use the `file` method, use the following command:
|
||
|
|
||
![]()
4 months ago
|
```sql
|
||
![]()
5 months ago
|
SELECT pg_tde_add_database_key_provider_file(
|
||
![]()
1 year ago
|
'file-provider',
|
||
|
json_object( 'type' VALUE 'remote', 'path' VALUE '/tmp/datafile-location' )
|
||
|
);"
|
||
|
```
|
||
|
|
||
![]()
4 months ago
|
Any parameter specified to the `add_key_provider` function can be a `json_object` instead of the string, similar to the above examples.
|