-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use domain-qualified name for extension
An experiment to see whether the current PostgreSQL extension installation and configuration can be abused to avoid namespace collision between extensions with the same names. This shows that for relocatable extensions, at least, it can be done, but it's pretty ugly: Everything has to refer to the full extension name --- here `github.com+theory+pg-semver` --- including file names: * Control file * SQL files * The `MODULERDIR` file in `Makefile` to install files into a directory with the long extension name * The `directory` entry in the control file to match `MODULERDIR` This change doesn't actually rename all of the `sql/*.sql` files, but updates the Makefile to generate the `sql/github.com+theory+pg-semver--$VERSION.sql` file Also had to update the SQL file to use `MODULE_PATHNAME` instead of `semver` so that it can be dynamically set, and change the tests to use `CREATE EXTENSION` to create the extension to test, rather than load the file directly. The latter was required for PostgreSQL 9.0 and earlier, which are no longer supported anyway. It's possible a lot of this could be automated in the `Makefile`: replace a short name with a longer name, move and rename files, etc., but it'd be kind of a pain. The alternative is to rename everything appropriately in the repository, but that'd be ugly. Besides, changing the extension name like this means that older versions would never be properly upgraded. It'd be nicer if PostgreSQL itself were updated to support some sort of schema packaging, where everything could go into one directory named for the repository. That's probably the smarter long-term goal.
- Loading branch information
Showing
10 changed files
with
42 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# github.com+theory+pg-semver extension | ||
comment = 'Semantic version data type' | ||
default_version = '0.32.1' | ||
directory = 'github.com+theory+pg-semver' | ||
module_pathname = '$libdir/github.com+theory+pg-semver' | ||
relocatable = true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters