Skip to content

Commit

Permalink
vscode format on save
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Oct 3, 2023
1 parent fbe18f0 commit 3034be9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions docs/extension_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ A Postgres [trusted lanuguage extension](https://github.com/aws/pg_tle) (TLE) co

For an extension to be valid, one file of each type must be present in an extension. For example, if you want to create an extension named `my-extension`, create the following folder structure:

* my-extension
* my-extension.control
* my-extension--0.0.1.sql
- my-extension
- my-extension.control
- my-extension--0.0.1.sql

In the above example, the `my-extension` folder contains the extension files. Names of the files are important. The control file should be named `<extension_name>.control` and the script file should be named `<extension_name>--<extension_version>.sql`.
In the above example, the `my-extension` folder contains the extension files. Names of the files are important. The control file should be named `<extension_name>.control` and the script file should be named `<extension_name>--<extension_version>.sql`.

## Control Files

A control file contains metadata about the extension in key-value pairs. The most common keys that you should consider setting are the following:

* default_version (string). The version to use if the user doesn't provide one in the `create extension` command.
* comment (string). Think of this as the description of the extension.
* requires (string). A comma separated list of extensions that this extension depends on.
* relocatable (boolean). Set to true if the extension's objects can be moved to a different schema after they are created.
* superuser (boolean). Set to true if only superusers should be able to create this extension.
- default_version (string). The version to use if the user doesn't provide one in the `create extension` command.
- comment (string). Think of this as the description of the extension.
- requires (string). A comma separated list of extensions that this extension depends on.
- relocatable (boolean). Set to true if the extension's objects can be moved to a different schema after they are created.
- superuser (boolean). Set to true if only superusers should be able to create this extension.

For example, the [pgjwt extenion's control file](https://github.com/michelp/pgjwt/blob/master/pgjwt.control) looks like this:
For example, the [pgjwt extension's control file](https://github.com/michelp/pgjwt/blob/master/pgjwt.control) looks like this:

```control
# pgjwt extension
Expand All @@ -34,4 +35,5 @@ superuser = false
For a complete list of keys available in a control file, refer to [Postgres documentation](https://www.postgresql.org/docs/current/extend-extensions.html#EXTEND-EXTENSIONS-FILES).

## Script Files

Script files contain the SQL objects to be created by the extension.

0 comments on commit 3034be9

Please sign in to comment.