My basic extension code is at location -> /Users/spartacus/Desktop/GSoC/CODE/my_extension
- my_extension.control
# my_extension.control
comment = 'Minimal Viable Product'
default_version = '1.0'
relocatable = true
# Installation script for version 1.0
# 1.0
# my_extension--1.0.sql
- my_extension--1.0.sql
-- my_extension--1.0.sql
-- Create necessary objects for version 1.0
CREATE TABLE my_table (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL
);
CREATE FUNCTION my_function() RETURNS void AS $$
BEGIN
-- Function logic goes here
END;
- MakeFile
DATA = my_extension--1.0.sql
PG_CONFIG ?= pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
-- cd command to navigate to the directory where your extension files are located. After connecting to that location, executing the make command throws this error:
make: Nothing to be done for 'all'
-- After executing make install:
/bin/sh /opt/homebrew/lib/postgresql/pgxs/src/makefiles/../../config/install-sh -c -d '/opt/homebrew/share/postgresql/contrib'/usr/bin/install -c -m 644 .//my_extension--1.0.sql '/opt/homebrew/share/postgresql/contrib/'
-- Running psql;
Then after executing CREATE EXTENSION my_extension; This error occurs:
ERROR: extension "my_extension" is not availableDETAIL: Could not open extension control file "/Applications/Postgres.app/Contents/Versions/15/share/postgresql/extension/my_extension.control": No such file or directory.HINT: The extension must first be installed on the system where PostgreSQL is running.
How to solve this issue?
.sqland.controlfile into your extension folder.sqland a.controlfile for them I copied the files to the directories. But I need to use the makefile to i install the control file remotely