In this section, we will learn how to create an extension, reusing some of the code you have seen in the previous chapters. In the following subsections, we will cover how to create, update, and manage your own extension for PostgreSQL.
Creating your own extension
Starting from scratch
Let's consider the sample database used throughout this book and make an extension called pg11ssp. The first version of the extension, version 1.0, will define the data structure (the tables and constraints) and a few functions. Let's start with the script file, which is partially shown in Listing 3. As you can see, it is a plain SQL set of statements:
CREATE TABLE IF NOT EXISTS files ( ... ); CREATE TABLE IF NOT EXISTS tags( ... ...