Reputation: 581
I'm trying to install a custom small extension for Postgres just for testing, but I can't do it.
My steps: 1.- Create the *.sql file (hola.sql):
CREATE OR REPLACE FUNCTION di_hola()
RETURNS void AS
$BODY$
BEGIN
RAISE NOTICE 'Hola';
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION di_hola()
OWNER TO postgres;
2.- Create control file (hola.control):
# hola extension
comment = 'Funcion para decir hola'
default_version = '1.0'
relocatable = false
3.- Makefile:
EXTENSION = hola
DATA = hola.sql
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
4.- Install it (in my case /usr/share/postgresql/10/extension
)
sudo make USE_PGXS=1 install
5.- From psql (psql -U postgres -h localhost -W
)
postgres=# create extension hola;
ERROR: extension "hola" has no installation script nor update path for version "1.0"
I can't find many information about this error. The files are properly installed in /usr/share/postgresql/10/extension
I have Postgres 10 under Linux Mint.
Thank you
Upvotes: 3
Views: 1479
Reputation: 246493
The SQL script for version 1.0 must be called
hola--1.0.sql
Upvotes: 7